1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef LIBRARIES_NACL_IO_PATH_H_
6 #define LIBRARIES_NACL_IO_PATH_H_
13 #include "sdk_util/macros.h"
20 Path(const Path
& path
);
21 explicit Path(const std::string
& path
);
23 // Return true of the first path item is '/'.
24 bool IsAbsolute() const;
26 // Return true if this is the root path (i.e. it has no parent)
29 // Return a part of the path
30 std::string
Part(size_t index
) const;
32 // Return the number of path parts
36 Path
& Append(const Path
& path
);
37 Path
& Append(const std::string
& path
);
38 Path
& Set(const std::string
& path
);
41 // Return the parent path.
43 std::string
Basename() const;
45 std::string
Join() const;
46 std::string
Range(size_t start
, size_t end
) const;
49 Path
& operator=(const Path
& p
);
50 Path
& operator=(const std::string
& str
);
51 bool operator==(const Path
& other
);
52 bool operator!=(const Path
& other
);
55 // Collapse the string list removing extraneous '.', '..' path components
62 } // namespace nacl_io
64 #endif // PACKAGES_LIBRARIES_NACL_IO_PATH_H_