src/hotspot/share/utilities/classpathStream.hpp
author stefank
Mon, 25 Nov 2019 12:33:15 +0100
changeset 59252 623722a6aeb9
parent 57897 e2e315f1aa63
permissions -rw-r--r--
8234740: Harmonize parameter order in Atomic - cmpxchg Reviewed-by: rehn, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
57897
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
     1
/*
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
     2
 * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
     4
 *
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
     7
 * published by the Free Software Foundation.
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
     8
 *
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    13
 * accompanied this code).
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    14
 *
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    18
 *
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    21
 * questions.
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    22
 *
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    23
 */
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    24
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    25
#ifndef SHARE_UTILITIES_CLASSPATHSTREAM_HPP
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    26
#define SHARE_UTILITIES_CLASSPATHSTREAM_HPP
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    27
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    28
class ClasspathStream : public StackObj {
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    29
  const char* _class_path;
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    30
  int _len;
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    31
  int _start;
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    32
  int _end;
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    33
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    34
public:
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    35
  ClasspathStream(const char* class_path) {
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    36
    _class_path = class_path;
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    37
    _len = (int)strlen(class_path);
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    38
    _start = 0;
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    39
    _end = 0;
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    40
  }
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    41
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    42
  bool has_next() {
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    43
    return _start < _len;
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    44
  }
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    45
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    46
  const char* get_next();
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    47
};
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    48
e2e315f1aa63 8230168: Use ClasspathStream for FileMapInfo::create_path_array
iklam
parents:
diff changeset
    49
#endif // SHARE_UTILITIES_CLASSPATHSTREAM_HPP