nomlib
Loading...
Searching...
No Matches
nom::Path Class Reference

Platform-agnostic handling of directory paths. More...

#include <Path.hpp>

Public Types

typedef std::string value_type

Public Member Functions

void init (void)
 Initialize the platform's native path delimiter.
 Path (void)
 Default constructor.
 ~Path (void)
 Destructor.
 Path (const std::string &p)
 Construct a complete object.
const value_type & native (void) const
 Obtain native path (directory) separator for the current platform.
const std::string & path (void) const
 Obtain assigned pathname.
Path & operator= (const Path &rhs)
 Assignment operator.
std::string prepend (const std::string &path) const
 Prefix the stored path to the given path, inserting a separator when needed.

Private Attributes

filesystem::path p_

Detailed Description

Platform-agnostic handling of directory paths.

This class is now a thin wrapper around nom::filesystem::path, preserving the historical nomlib API while gaining proper path decomposition.

Inspired by Boost::Filesystem

See also
http://www.boost.org/doc/libs/1_55_0/libs/filesystem/doc/reference.html#class-path

Definition at line 46 of file Path.hpp.

Member Typedef Documentation

◆ value_type

typedef std::string nom::Path::value_type

Platform-dependent data typedef used for defining the preferred file path separator.

Definition at line 51 of file Path.hpp.

Constructor & Destructor Documentation

◆ Path()

nom::Path::Path ( const std::string & p)

Construct a complete object.

Parameters
pThe relative or absolute path to a file or directory.

Member Function Documentation

◆ init()

void nom::Path::init ( void )

Initialize the platform's native path delimiter.

Remarks
Kept for backward compatibility; the separator is provided by nom::filesystem::path::preferred_separator.

Member Data Documentation

◆ p_

filesystem::path nom::Path::p_
private

Definition at line 84 of file Path.hpp.


The documentation for this class was generated from the following file: