LogCabin
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Public Attributes
LogCabin::Tree::Internal::Path Class Reference

This is used by Tree to parse symbolic paths into their components. More...

#include <Tree.h>

List of all members.

Public Member Functions

 Path (const std::string &symbolic)
 Constructor.
std::string parentsThrough (std::vector< std::string >::const_iterator end) const
 Used to generate error messages during path lookup.

Public Attributes

Result result
 Status and error message from the constructor.
std::string symbolic
 The exact argument given to the constructor.
std::vector< std::string > parents
 The directories needed to traverse to get to the target.
std::string target
 The final component of the path.

Detailed Description

This is used by Tree to parse symbolic paths into their components.

Definition at line 227 of file Tree.h.


Constructor & Destructor Documentation

LogCabin::Tree::Internal::Path::Path ( const std::string &  symbolic) [explicit]

Constructor.

Parameters:
symbolicA path delimited by slashes. This must begin with a slash. (It should not include "/root" to arrive at the root directory.)
Warning:
The caller must check "result" to see if the path was parsed successfully.

Definition at line 226 of file Tree.cc.


Member Function Documentation

std::string LogCabin::Tree::Internal::Path::parentsThrough ( std::vector< std::string >::const_iterator  end) const

Used to generate error messages during path lookup.

Parameters:
endThe last component of 'parents' to include in the returned string; this is typically the component that caused an error in path traversal.
Returns:
The prefix of 'parents' up to and including the given end position. This is returned as a slash-delimited string not including "/root".

Definition at line 261 of file Tree.cc.


Member Data Documentation

Status and error message from the constructor.

Possible errors are:

  • INVALID_ARGUMENT if path is malformed.

Definition at line 258 of file Tree.h.

The exact argument given to the constructor.

Definition at line 263 of file Tree.h.

std::vector<std::string> LogCabin::Tree::Internal::Path::parents

The directories needed to traverse to get to the target.

This usually begins with "root" to get from the super root to the root directory, then includes the components of the symbolic path up to but not including the target. If the symbolic path is "/", this will be empty.

Definition at line 271 of file Tree.h.

The final component of the path.

This is usually at the end of the symbolic path. If the symbolic path is "/", this will be "root", used to get from the super root to the root directory.

Definition at line 278 of file Tree.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines