# # patch "ChangeLog" # from [67efcbf870e9b7445139b11b7b3e34694a5cda47] # to [2aefa27e70d5c80c2458a8a9192f9b840b93b571] # # patch "paths.hh" # from [1b314c3e7e6e45a97b40b6cef0fe140f48188209] # to [47fe415dfa8a572a5bc065b5f07f98e48a2259a2] # ======================================================================== --- ChangeLog 67efcbf870e9b7445139b11b7b3e34694a5cda47 +++ ChangeLog 2aefa27e70d5c80c2458a8a9192f9b840b93b571 @@ -1,5 +1,10 @@ 2005-08-24 Nathaniel Smith - + + * paths.hh (class file_path): Make "convenience functions" + required. + +2005-08-24 Nathaniel Smith + * Switch rest of instances to using convenience functions. 2005-08-24 Nathaniel Smith ======================================================================== --- paths.hh 1b314c3e7e6e45a97b40b6cef0fe140f48188209 +++ paths.hh 47fe415dfa8a572a5bc065b5f07f98e48a2259a2 @@ -50,19 +50,6 @@ { public: file_path(); - typedef enum { internal, external } source_type; - // input is always in utf8, because everything in our world is always in - // utf8 (except interface code itself). - // external paths: - // -- are converted to internal syntax (/ rather than \, etc.) - // -- normalized - // -- assumed to be relative to the user's cwd, and munged - // to become relative to root of the working copy instead - // both types of paths: - // -- are confirmed to be normalized and relative - // -- not to be in MT/ - file_path(source_type type, std::string const & path); - file_path(source_type type, utf8 const & path); // join a file_path out of pieces file_path(std::vector const & pieces); @@ -78,14 +65,32 @@ bool operator <(const file_path & other) const { return data < other.data; } + +private: + typedef enum { internal, external } source_type; + // input is always in utf8, because everything in our world is always in + // utf8 (except interface code itself). + // external paths: + // -- are converted to internal syntax (/ rather than \, etc.) + // -- normalized + // -- assumed to be relative to the user's cwd, and munged + // to become relative to root of the working copy instead + // both types of paths: + // -- are confirmed to be normalized and relative + // -- not to be in MT/ + file_path(source_type type, std::string const & path); + file_path(source_type type, utf8 const & path); + friend file_path file_path_internal(std::string const & path); + friend file_path file_path_external(std::string const & path); + }; -// normally you will use one of these convenience functions: -inline file_path file_path_internal(std::string & path) +// these are the public file_path constructors +inline file_path file_path_internal(std::string const & path) { return file_path(file_path::internal, path); } -inline file_path file_path_external(std::string & path) +inline file_path file_path_external(std::string const & path) { return file_path(file_path::external, path); }