summaryrefslogtreecommitdiff
path: root/rld.h
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-09-05 18:16:40 +1000
committerChris Johns <chrisj@rtems.org>2014-09-05 18:16:40 +1000
commit5679661069a8b9acaec26d61c8da797f0726506b (patch)
treeb3a8af2246ebbdfdd988a41a7c9658b374d0f165 /rld.h
parent566f389fb9f7f2b124e6055947c9edc8820107b6 (diff)
Add support for RTEMS BSP or user supplied CFLAGS. Remove march/mcpu.
Added support to read an RTEMS BSP pkgconfig file and ste the CC flags.
Diffstat (limited to 'rld.h')
-rw-r--r--rld.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/rld.h b/rld.h
index 1f5e60b..efe3f46 100644
--- a/rld.h
+++ b/rld.h
@@ -122,6 +122,14 @@ namespace rld
typedef std::vector < std::string > strings;
/**
+ * Does a string start with another string ?
+ */
+ inline bool starts_with(const std::string& s1, const std::string& s2)
+ {
+ return s2.size () <= s1.size () && s1.compare (0, s2.size (), s2) == 0;
+ }
+
+ /**
* Trim from start.
*/
inline std::string& ltrim (std::string &s)
@@ -195,7 +203,7 @@ namespace rld
*/
inline strings& split (strings& se,
const std::string& s,
- char delimiter,
+ char delimiter = ' ',
bool strip_quotes = true,
bool strip_whitespace = true,
bool empty = false)
@@ -236,6 +244,16 @@ namespace rld
}
/**
+ * Convert a string to lower case.
+ */
+ inline std::string tolower (const std::string& sin)
+ {
+ std::string s = sin;
+ std::transform (s.begin (), s.end (), s.begin (), ::tolower);
+ return s;
+ }
+
+ /**
* Increment the verbose level.
*/
void verbose_inc ();