diff options
author | Chris Lattner <sabre@nondot.org> | 2003-12-29 05:06:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-12-29 05:06:38 +0000 |
commit | 9fc8a3ec2e7dfe0cdbeca72b8b2742f1e4ac1b42 (patch) | |
tree | 4134f3f0082750835a6ec9b710b899b6bdc282f8 /include | |
parent | 590c6cf7329490e8d49967f27ec97ddd02df545f (diff) | |
download | external_llvm-9fc8a3ec2e7dfe0cdbeca72b8b2742f1e4ac1b42.zip external_llvm-9fc8a3ec2e7dfe0cdbeca72b8b2742f1e4ac1b42.tar.gz external_llvm-9fc8a3ec2e7dfe0cdbeca72b8b2742f1e4ac1b42.tar.bz2 |
add new function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10638 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/Support/StringExtras.h | 10 | ||||
-rw-r--r-- | include/llvm/ADT/StringExtras.h | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/include/Support/StringExtras.h b/include/Support/StringExtras.h index 08e5eb7..f491e93 100644 --- a/include/Support/StringExtras.h +++ b/include/Support/StringExtras.h @@ -97,6 +97,16 @@ static inline std::string ftostr(double V) { return Buffer; } + +/// getToken - This function extracts one token from source, ignoring any +/// leading characters that appear in the Delimiters string, and ending the +/// token at any of the characters that appear in the Delimiters string. If +/// there are no tokens in the source string, an empty string is returned. +/// The Source source string is updated in place to remove the returned string +/// and any delimiter prefix from it. +std::string getToken(std::string &Source, + const char *Delimiters = " \t\n\v\f\r"); + } // End llvm namespace #endif diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h index 08e5eb7..f491e93 100644 --- a/include/llvm/ADT/StringExtras.h +++ b/include/llvm/ADT/StringExtras.h @@ -97,6 +97,16 @@ static inline std::string ftostr(double V) { return Buffer; } + +/// getToken - This function extracts one token from source, ignoring any +/// leading characters that appear in the Delimiters string, and ending the +/// token at any of the characters that appear in the Delimiters string. If +/// there are no tokens in the source string, an empty string is returned. +/// The Source source string is updated in place to remove the returned string +/// and any delimiter prefix from it. +std::string getToken(std::string &Source, + const char *Delimiters = " \t\n\v\f\r"); + } // End llvm namespace #endif |