summaryrefslogtreecommitdiff
path: root/rld-path.h
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-09-08 16:06:48 +1000
committerChris Johns <chrisj@rtems.org>2014-09-08 16:06:48 +1000
commit52d988128d5014002b0431f7d4f5de0ff50f92a9 (patch)
treee8101d9dd4926db4077413fecbaa18f490c5e26b /rld-path.h
parent4c9a892d009c5b8f1952cf3450dda32148af887e (diff)
RTEMS trace linker builds trace applications.
The trace linker builds the both_hello example in examples-v2. Move the various string support functions into a C++ file and stop being inlined. Make them return const std::string. Add ld support to rld-cc. Add search path support to rld-config so installed common files can be used. Fix the path bugs. Add an absolute path function to rld-path.
Diffstat (limited to 'rld-path.h')
-rw-r--r--rld-path.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/rld-path.h b/rld-path.h
index 0e1329a..d73c59b 100644
--- a/rld-path.h
+++ b/rld-path.h
@@ -45,29 +45,29 @@ namespace rld
* Return the basename of the file name.
*
* @param name The full file name.
- * @return std::string The basename of the file.
+ * @return const std::string The basename of the file.
*/
- std::string basename (const std::string& name);
+ const std::string basename (const std::string& name);
/**
* Return the dirname of the file name.
*
* @param name The full file name.
- * @return std::string The dirname of the file.
+ * @return const std::string The dirname of the file.
*/
- std::string dirname (const std::string& name);
+ const std::string dirname (const std::string& name);
/**
* Return the extension of the file name.
*
* @param name The full file name.
- * @return std::string The extension of the file.
+ * @return const std::string The extension of the file.
*/
- std::string extension (const std::string& name);
+ const std::string extension (const std::string& name);
/**
- * Split a path from a string with a delimiter to the path container. Add
- * only the paths that exist and ignore those that do not.
+ * Split a path from a string with the path seperator to the path
+ * container. Add only the paths that exist and ignore those that do not.
*
* @param path The paths as a single string delimited by the path
* separator.
@@ -100,6 +100,15 @@ namespace rld
std::string& joined);
/**
+ * Return the absolute path given a path and using the current working
+ * directory. The path is flattened removing any '..' sequences.
+ *
+ * @param path The path to be return as absolute.
+ * @return const std::string The absolute path.
+ */
+ const std::string path_abs (const std::string& path);
+
+ /**
* Check the path is a file using a stat call.
*
* @param path The path to check.