]> git.mxchange.org Git - simgear.git/blobdiff - simgear/misc/sg_path.hxx
Make tsync part of libSimGearCore when building shared libraries
[simgear.git] / simgear / misc / sg_path.hxx
index e71c5f54d9a55e7312e9b7ef8ac20102edddd380..1f9dfbe706c4d3a0d663001e4d977d5446be907a 100644 (file)
@@ -111,6 +111,12 @@ public:
      */
     void concat( const std::string& p );
 
+    /**
+     * Returns a string with the absolute pathname that names the same file, whose
+     * resolution does not involve '.', '..', or symbolic links.
+     */
+    std::string realpath() const;
+
     /**
      * Get the file part of the path (everything after the last path sep)
      * @return file string
@@ -124,7 +130,7 @@ public:
     std::string dir() const;
   
     /**
-     * Get the base part of the path (everything but the extension.)
+     * Get the base part of the path (everything but the final extension.)
      * @return the base string
      */
     std::string base() const;
@@ -236,6 +242,13 @@ private:
     mutable time_t _modTime;
 };
 
+/// Output to an ostream
+template<typename char_type, typename traits_type>
+inline
+std::basic_ostream<char_type, traits_type>&
+operator<<(std::basic_ostream<char_type, traits_type>& s, const SGPath& p)
+{ return s << "Path \"" << p.str() << "\""; }
+
 
 /**
  * Split a directory string into a list of it's parent directories.