[llvm-commits] [llvm] r156665 - /llvm/trunk/include/llvm/ADT/StringRef.h
Michael J. Spencer
bigcheesegs at gmail.com
Fri May 11 16:34:39 PDT 2012
Author: mspencer
Date: Fri May 11 18:34:39 2012
New Revision: 156665
URL: http://llvm.org/viewvc/llvm-project?rev=156665&view=rev
Log:
Add doxygen comments.
Modified:
llvm/trunk/include/llvm/ADT/StringRef.h
Modified: llvm/trunk/include/llvm/ADT/StringRef.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringRef.h?rev=156665&r1=156664&r2=156665&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringRef.h (original)
+++ llvm/trunk/include/llvm/ADT/StringRef.h Fri May 11 18:34:39 2012
@@ -490,14 +490,20 @@
return std::make_pair(slice(0, Idx), slice(Idx+1, npos));
}
+ /// ltrim - Return string with consecutive characters in \arg Chars starting
+ /// from the left removed.
StringRef ltrim(StringRef Chars = " \t\n\v\f\r") const {
return drop_front(std::min(Length, find_first_not_of(Chars)));
}
+ /// rtrim - Return string with consecutive characters in \arg Chars starting
+ /// from the right removed.
StringRef rtrim(StringRef Chars = " \t\n\v\f\r") const {
return drop_back(Length - std::min(Length, find_last_not_of(Chars) + 1));
}
+ /// trim - Return string with consecutive characters in \arg Chars starting
+ /// from the left and right removed.
StringRef trim(StringRef Chars = " \t\n\v\f\r") const {
return ltrim(Chars).rtrim(Chars);
}
More information about the llvm-commits
mailing list