]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/tools/build/src/engine/pathsys.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / tools / build / src / engine / pathsys.h
index 839476e9402abac2e814dd6d05012d5d4c6748de..ffb62c18ef4e5eab451dfcf0863671d1c01b50e1 100644 (file)
@@ -4,6 +4,13 @@
  * This file is part of Jam - see jam.c for Copyright information.
  */
 
+/*
+Copyright 2020 RenĂ© Ferdinand Rivera Morell
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+
 /*
  * pathsys.h - PATHNAME struct
  */
@@ -15,7 +22,7 @@
  * same name - it never appears in the bound name of a target.
  *
  * (member) - archive member name: the syntax is arbitrary, but must agree in
- * path_parse(), path_build() and the Jambase.
+ * path_parse(), path_build().
  */
 
 #ifndef PATHSYS_VP_20020211_H
@@ -25,6 +32,8 @@
 #include "object.h"
 #include "jam_strings.h"
 
+#include <string>
+
 
 typedef struct _pathpart
 {
@@ -84,4 +93,23 @@ char * executable_path( char const * argv0 );
 
 void path_done( void );
 
+namespace b2
+{
+    namespace paths
+    {
+        inline bool is_rooted(const std::string &p)
+        {
+            #if NT
+            return
+                (p.size() >= 1 && (p[0] == '/' || p[0] == '\\')) ||
+                (p.size() >= 3 && p[1] == ':' && (p[2] == '/' || p[2] == '\\'));
+            #else
+            return
+                (p.size() >= 1 && (p[0] == '/' || p[0] == '\\'));
+            #endif
+        }
+        std::string normalize(const std::string &p);
+    }
+}
+
 #endif