From e77716188861d4aa83b227a90e04a66b63baeb1f Mon Sep 17 00:00:00 2001 From: click Date: Sat, 5 Jun 2010 00:59:25 +0200 Subject: 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 --- dep/include/g3dlite/G3D/stringutils.h | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'dep/include/g3dlite/G3D/stringutils.h') 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 +#include 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& 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 - -- cgit v1.2.3