#ifndef PATH_SGA_05_03_09_H #define PATH_SGA_05_03_09_H #include #include "boost/filesystem/convenience.hpp" #include "boost/filesystem/operations.hpp" #include "boost/filesystem/path.hpp" #include "uExport.h" /** * \class TuPath * \author SGA * \date Wednesday, March 09, 2005 2:34:20 PM * \brief Path class. * * This class is used to manipulate paths including raw filenames. * It is an extension of boost::filesystem::path and provides additional * functionality lifted from the original Mentor TuPath class. We * use the boost class for its portability and extend as necessary. * */ class RFCN_U_EXPORT TuPath { public : TuPath(); TuPath( const boost::filesystem::path& src ); TuPath( const std::string& src ); TuPath( const std::string& src, boost::filesystem::path::name_check checker ); TuPath( const TuPath& rhs ); bool Createable() const; bool Readable() const; bool ReadWriteable() const; bool Writeable() const; boost::filesystem::path root_path() const { return _Path.root_path(); } std::string root_name() const { return _Path.root_name(); } std::string root_directory() const { return _Path.root_directory(); } boost::filesystem::path relative_path() const { return _Path.relative_path(); } std::string leaf() const { return _Path.leaf(); } boost::filesystem::path branch_path() const { return _Path.branch_path(); } // query functions: bool empty() const { return _Path.empty(); } bool is_complete() const { return _Path.is_complete(); } bool has_root_path() const { return _Path.has_root_path(); } bool has_root_name() const { return _Path.has_root_name(); } bool has_root_directory() const { return _Path.has_root_directory(); } bool has_relative_path() const { return _Path.has_relative_path(); } bool has_leaf() const { return _Path.has_leaf(); } bool has_branch_path() const { return _Path.has_branch_path(); } std::string native_directory_string() const { return _Path.native_directory_string(); } std::string native_file_string() const { return _Path.native_file_string(); } const std::string& string() const { return _Path.string(); } private : boost::filesystem::path _Path; }; #endif //PATH_SGA_05_03_09_H