diff options
author | click <none@none> | 2010-06-05 00:59:25 +0200 |
---|---|---|
committer | click <none@none> | 2010-06-05 00:59:25 +0200 |
commit | e77716188861d4aa83b227a90e04a66b63baeb1f (patch) | |
tree | ce72764181a760314ec851f7535052dcf75649db /dep/include/g3dlite/G3D/stringutils.h | |
parent | 1426c2970f42a2d065198806f750bf5dd28d580b (diff) |
HIGHLY EXPERIMENTAL - USE AT YOUR OWN RISK
Implement the use of the new vmap3-format by Lynx3d (mad props to you for this, and thanks for the talks earlier)
+ reduced Vmap size to less than one third, and improve precision
+ indoor/outdoor check which allows automatic unmounting of players
+ additional area information from WMOAreaTable.dbc, removed existing "hacks"
+ WMO liquid information for swimming and fishing correctly in buildings/cities/caves/instances (lava and slime WILL hurt from now on!)
- buildfiles for windows are not properly done, and will need to be sorted out
NOTE: Do NOT annoy Lynx3d about this, any issues with this "port" is entirely our fault !
THIS REVISION IS CONSIDERED UNSTABLE AND CONTAINS WORK IN PROGRESS - USE AT YOUR OWN RISK!
--HG--
branch : trunk
Diffstat (limited to 'dep/include/g3dlite/G3D/stringutils.h')
-rw-r--r-- | dep/include/g3dlite/G3D/stringutils.h | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/dep/include/g3dlite/G3D/stringutils.h b/dep/include/g3dlite/G3D/stringutils.h index 59449313bf5..e15a757a7a6 100644 --- a/dep/include/g3dlite/G3D/stringutils.h +++ b/dep/include/g3dlite/G3D/stringutils.h @@ -1,10 +1,10 @@ /** @file stringutils.h - - @maintainer Morgan McGuire, matrix@graphics3d.com - + + @maintainer Morgan McGuire, http://graphics.cs.williams.edu + @author 2000-09-09 - @edited 2002-11-30 + @edited 2008-08-05 */ #ifndef G3D_STRINGUTILS_H @@ -12,12 +12,22 @@ #include "G3D/platform.h" #include "G3D/Array.h" -#include <string> +#include <cstring> namespace G3D { extern const char* NEWLINE; +/** Separates a comma-separated line, properly escaping commas within + double quotes (") and super quotes ("""). This matches Microsoft Excel's + CSV output. + + \param stripQuotes If true, strips leading and trailing " and """ + + \sa G3D::stringSplit, G3D::TextInput, G3D::readWholeFile +*/ +void parseCommaSeparated(const std::string s, Array<std::string>& array, bool stripQuotes = true); + /** Returns true if the test string begins with the pattern string. */ @@ -91,36 +101,36 @@ std::string trimWhitespace( /** These standard C functions are renamed for clarity/naming conventions and to return bool, not int. */ -inline bool isWhiteSpace(const char c) { +inline bool isWhiteSpace(const unsigned 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) { +inline bool isNewline(const unsigned 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) { +inline bool isDigit(const unsigned 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) { +inline bool isLetter(const unsigned char c) { return isalpha(c) != 0; } -inline bool isSlash(const char c) { +inline bool isSlash(const unsigned char c) { return (c == '\\') || (c == '/'); } -inline bool isQuote(const char c) { +inline bool isQuote(const unsigned char c) { return (c == '\'') || (c == '\"'); } @@ -128,4 +138,3 @@ inline bool isQuote(const char c) { #endif - |