aboutsummaryrefslogtreecommitdiff
path: root/dep/include/g3dlite/G3D/stringutils.h
diff options
context:
space:
mode:
authormaximius <none@none>2009-10-17 15:35:07 -0700
committermaximius <none@none>2009-10-17 15:35:07 -0700
commit26b5e033ffde3d161382fc9addbfa99738379641 (patch)
treea344f369ca32945f787a02dee35c3dbe342bed7e /dep/include/g3dlite/G3D/stringutils.h
parentf21f47005dcb6b76e1abc9f35fbcd03eed191bff (diff)
*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget --HG-- branch : trunk
Diffstat (limited to 'dep/include/g3dlite/G3D/stringutils.h')
-rw-r--r--dep/include/g3dlite/G3D/stringutils.h26
1 files changed, 0 insertions, 26 deletions
diff --git a/dep/include/g3dlite/G3D/stringutils.h b/dep/include/g3dlite/G3D/stringutils.h
index 59449313bf5..eae346b0985 100644
--- a/dep/include/g3dlite/G3D/stringutils.h
+++ b/dep/include/g3dlite/G3D/stringutils.h
@@ -1,37 +1,28 @@
/**
@file stringutils.h
-
@maintainer Morgan McGuire, matrix@graphics3d.com
-
@author 2000-09-09
@edited 2002-11-30
*/
-
#ifndef G3D_STRINGUTILS_H
#define G3D_STRINGUTILS_H
-
#include "G3D/platform.h"
#include "G3D/Array.h"
#include <string>
-
namespace G3D {
-
extern const char* NEWLINE;
-
/**
Returns true if the test string begins with the pattern string.
*/
bool beginsWith(
const std::string& test,
const std::string& pattern);
-
/**
Returns true if the test string ends with the pattern string.
*/
bool endsWith(
const std::string& test,
const std::string& pattern);
-
/**
Produces a new string that is the input string
wrapped at a certain number of columns (where
@@ -42,34 +33,28 @@ bool endsWith(
std::string wordWrap(
const std::string& input,
int numCols);
-
/**
A comparison function for passing to Array::sort.
*/
int stringCompare(
const std::string& s1,
const std::string& s2);
-
int stringPtrCompare(
const std::string* s1,
const std::string* s2);
-
/**
Returns a new string that is an uppercase version of x.
*/
std::string toUpper(
const std::string& x);
-
std::string toLower(
const std::string& x);
-
/**
Splits x at each occurance of splitChar.
*/
G3D::Array<std::string> stringSplit(
const std::string& x,
char splitChar);
-
/**
joinChar is not inserted at the beginning or end, just in between
elements.
@@ -77,55 +62,44 @@ G3D::Array<std::string> stringSplit(
std::string stringJoin(
const G3D::Array<std::string>& a,
char joinChar);
-
std::string stringJoin(
const G3D::Array<std::string>& a,
const std::string& joinStr);
-
/**
Strips whitespace from both ends of the string.
*/
std::string trimWhitespace(
const std::string& s);
-
/** These standard C functions are renamed for clarity/naming
conventions and to return bool, not int.
*/
inline bool isWhiteSpace(const char c) {
return isspace(c) != 0;
}
-
/** These standard C functions are renamed for clarity/naming
conventions and to return bool, not int.
*/
inline bool isNewline(const char c) {
return (c == '\n') || (c == '\r');
}
-
/** These standard C functions are renamed for clarity/naming
conventions and to return bool, not int.
*/
inline bool isDigit(const char c) {
return isdigit(c) != 0;
}
-
/** These standard C functions are renamed for clarity/naming
conventions and to return bool, not int.
*/
inline bool isLetter(const char c) {
return isalpha(c) != 0;
}
-
inline bool isSlash(const char c) {
return (c == '\\') || (c == '/');
}
-
inline bool isQuote(const char c) {
return (c == '\'') || (c == '\"');
}
-
}; // namespace
-
#endif
-