diff options
author | Chris Johns <chrisj@rtems.org> | 2014-09-05 18:16:40 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-09-05 18:16:40 +1000 |
commit | 5679661069a8b9acaec26d61c8da797f0726506b (patch) | |
tree | b3a8af2246ebbdfdd988a41a7c9658b374d0f165 /rld.h | |
parent | 566f389fb9f7f2b124e6055947c9edc8820107b6 (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.h | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -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 (); |