# # patch "ChangeLog" # from [5983a31df9f39a73b4e61b58e7dd2c46c0f5858f] # to [1090c79c97099815b389755788e15849163caec8] # # patch "paths.hh" # from [0b8007bc1bf1c2f64cb27fcfd16cd6c739277bcb] # to [1b314c3e7e6e45a97b40b6cef0fe140f48188209] # ======================================================================== --- ChangeLog 5983a31df9f39a73b4e61b58e7dd2c46c0f5858f +++ ChangeLog 1090c79c97099815b389755788e15849163caec8 @@ -1,5 +1,12 @@ 2005-08-24 Nathaniel Smith + * paths.hh (file_path_internal, file_path_external): Define + convenience functions. + (file_path, bookkeeping_path, system_path): Add default + constructors. + +2005-08-24 Nathaniel Smith + * app_state.cc, change_set.cc, change_set.hh, commands.cc: * inodeprint.cc, manifest.cc, rcs_import.cc, restrictions.cc: * work.cc: Audit all calls to file_path() to add internal/external ======================================================================== --- paths.hh 0b8007bc1bf1c2f64cb27fcfd16cd6c739277bcb +++ paths.hh 1b314c3e7e6e45a97b40b6cef0fe140f48188209 @@ -49,6 +49,7 @@ class file_path : public any_path { 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). @@ -79,9 +80,21 @@ { return data < other.data; } }; +// normally you will use one of these convenience functions: +inline file_path file_path_internal(std::string & path) +{ + return file_path(file_path::internal, path); +} +inline file_path file_path_external(std::string & path) +{ + return file_path(file_path::external, path); +} + + class bookkeeping_path : public any_path { public: + bookkeeping_path(); // path _should_ contain the leading MT/ // and _should_ look like an internal path // usually you should just use the / operator as a constructor! @@ -97,6 +110,7 @@ class system_path : public any_path { public: + system_path(); // this path can contain anything, and it will be absolutified and // tilde-expanded. it will considered to be relative to the directory // monotone started in. it should be in utf8.