DubiousEngine  0.2.0
Simple Game Engine
Dubious::Utility::File_path Class Reference

Path and Filename information. More...

#include <File_path.h>

Public Member Functions

 File_path (const std::string &Path)
 Constructor. More...
 
std::string full_path () const
 Returns the full path that you specified to the constructor. More...
 
std::string path () const
 Returns just the path part of the full path. More...
 
std::string file () const
 Returns just the file part. This means only the last token. More...
 

Detailed Description

Path and Filename information.

The FilePath object is used to hold path and file information. This is a simple helper class that just moves all of the annoying path parsing into one central location. It only uses the '/' character as a separator.

Constructor & Destructor Documentation

Dubious::Utility::File_path::File_path ( const std::string &  Path)

Constructor.

Takes in a Path in the usual form. It's smart enough to figure out if it's a full or relative path. Passing it an empty string will throw an exception

Parameters
Path- [in] the path: /blah/blah/file.txt

Member Function Documentation

std::string Dubious::Utility::File_path::file ( ) const

Returns just the file part. This means only the last token.

Returns
the file only: file.txt
std::string Dubious::Utility::File_path::full_path ( ) const

Returns the full path that you specified to the constructor.

Returns
the full path: /blah/blah/file.txt
std::string Dubious::Utility::File_path::path ( ) const

Returns just the path part of the full path.

This means everything except the final token. Note that this will end in a final '/'

Returns
the path only: /blah/blah/

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