summaryrefslogtreecommitdiff
path: root/linkers
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-09-06 20:17:56 +1000
committerChris Johns <chrisj@rtems.org>2014-09-06 20:17:56 +1000
commita72a9e357d2db00fb05ab2f752033eea88408420 (patch)
tree24d7c000e42618c02c8e3b9ceec08cd161d7c008 /linkers
parentb233be7a3fe7d5a26fd9de5dded6bfbee1d7a000 (diff)
Add a path str. Remove the duplicate split call.
Diffstat (limited to 'linkers')
-rw-r--r--linkers/rld.cpp18
-rw-r--r--linkers/rld.h19
2 files changed, 8 insertions, 29 deletions
diff --git a/linkers/rld.cpp b/linkers/rld.cpp
index 997291d..a239ddc 100644
--- a/linkers/rld.cpp
+++ b/linkers/rld.cpp
@@ -93,24 +93,6 @@ namespace rld
}
void
- split (const std::string& str, strings& strs, char separator)
- {
- if (str.size ())
- {
- std::string::size_type start = 0;
- std::string::size_type end = 0;
- while (start != std::string::npos)
- {
- end = str.find_first_of (separator, start);
- if (end == std::string::npos)
- end = str.size ();
- strs.push_back (str.substr (start, end - start));
- start = str.find_first_not_of (separator, end);
- }
- }
- }
-
- void
map (rld::files::cache& cache, rld::symbols::table& symbols)
{
std::cout << "Archive files : " << cache.archive_count () << std::endl;
diff --git a/linkers/rld.h b/linkers/rld.h
index efe3f46..2c5fdd2 100644
--- a/linkers/rld.h
+++ b/linkers/rld.h
@@ -38,12 +38,14 @@
*/
#if __WIN32__
#define RLD_PATH_SEPARATOR '\\'
+#define RLD_PATH_SEPARATOR_STR "\\"
#define RLD_PATHSTR_SEPARATOR ';'
#define RLD_PATHSTR_SEPARATOR_STR ";"
#define RLD_DRIVE_SEPARATOR (1)
#define RLD_LINE_SEPARATOR "\r\n"
#else
#define RLD_PATH_SEPARATOR '/'
+#define RLD_PATH_SEPARATOR_STR "/"
#define RLD_PATHSTR_SEPARATOR ':'
#define RLD_PATHSTR_SEPARATOR_STR ":"
#define RLD_DRIVE_SEPARATOR (0)
@@ -201,12 +203,12 @@ namespace rld
*
* @todo The split should optionally honour string quoting.
*/
- inline strings& split (strings& se,
- const std::string& s,
- char delimiter = ' ',
- bool strip_quotes = true,
- bool strip_whitespace = true,
- bool empty = false)
+ inline strings split (strings& se,
+ const std::string& s,
+ char delimiter = ' ',
+ bool strip_quotes = true,
+ bool strip_whitespace = true,
+ bool empty = false)
{
std::stringstream ss(s);
std::string e;
@@ -280,11 +282,6 @@ namespace rld
typedef std::vector < std::string > strings;
/**
- * Split a string into strings by the separator.
- */
- void split (const std::string& str, strings& strs, char separator);
-
- /**
* Map of the symbol table.
*/
void map (rld::files::cache& cache, rld::symbols::table& symbols);