]> git.mxchange.org Git - simgear.git/blobdiff - simgear/misc/fgpath.cxx
Use plib rad/degrees conversion constants.
[simgear.git] / simgear / misc / fgpath.cxx
index 0ae86cd81a08cb07a51b5c56322a2a9d32aa4046..e6317a3c77b60ec6cbc20bb265236250576db4aa 100644 (file)
@@ -100,3 +100,14 @@ void FGPath::concat( const string p ) {
        path += part;
     }
 }
+
+
+// get the directory part of the path.
+string FGPath::dir() {
+    int index = path.rfind(FG_PATH_SEP);
+    if (index >= 0) {
+       return path.substr(0, index);
+    } else {
+       return "";
+    }
+}