diff --git a/dtool/src/dtoolutil/Sources.pp b/dtool/src/dtoolutil/Sources.pp index b73ee2e067..7c2638caa6 100644 --- a/dtool/src/dtoolutil/Sources.pp +++ b/dtool/src/dtoolutil/Sources.pp @@ -24,6 +24,7 @@ panda_getopt.h panda_getopt_long.h panda_getopt_impl.h \ pfstream.h pfstream.I pfstreamBuf.h \ preprocess_argv.h \ + string_utils.h string_utils.I \ stringDecoder.h stringDecoder.I \ textEncoder.h textEncoder.I \ unicodeLatinMap.h \ @@ -43,6 +44,7 @@ panda_getopt_impl.cxx \ pfstreamBuf.cxx pfstream.cxx \ preprocess_argv.cxx \ + string_utils.cxx \ stringDecoder.cxx \ textEncoder.cxx \ unicodeLatinMap.cxx \ @@ -63,6 +65,7 @@ panda_getopt.h panda_getopt_long.h panda_getopt_impl.h \ pfstream.h pfstream.I pfstreamBuf.h \ preprocess_argv.h \ + string_utils.h string_utils.I \ stringDecoder.h stringDecoder.I \ textEncoder.h textEncoder.I \ unicodeLatinMap.h \ diff --git a/dtool/src/dtoolutil/p3dtoolutil_composite2.cxx b/dtool/src/dtoolutil/p3dtoolutil_composite2.cxx index 7d1198beda..289ce8f1e9 100644 --- a/dtool/src/dtoolutil/p3dtoolutil_composite2.cxx +++ b/dtool/src/dtoolutil/p3dtoolutil_composite2.cxx @@ -4,6 +4,7 @@ #include "pfstream.cxx" #include "pfstreamBuf.cxx" #include "preprocess_argv.cxx" +#include "string_utils.cxx" #include "stringDecoder.cxx" #include "textEncoder.cxx" #include "unicodeLatinMap.cxx" diff --git a/panda/src/putil/string_utils.I b/dtool/src/dtoolutil/string_utils.I similarity index 100% rename from panda/src/putil/string_utils.I rename to dtool/src/dtoolutil/string_utils.I diff --git a/panda/src/putil/string_utils.cxx b/dtool/src/dtoolutil/string_utils.cxx similarity index 100% rename from panda/src/putil/string_utils.cxx rename to dtool/src/dtoolutil/string_utils.cxx diff --git a/panda/src/putil/string_utils.h b/dtool/src/dtoolutil/string_utils.h similarity index 53% rename from panda/src/putil/string_utils.h rename to dtool/src/dtoolutil/string_utils.h index 3e8c04d2f5..8fda82a8b0 100644 --- a/panda/src/putil/string_utils.h +++ b/dtool/src/dtoolutil/string_utils.h @@ -15,51 +15,51 @@ #ifndef STRING_UTILS_H #define STRING_UTILS_H -#include "pandabase.h" +#include "dtoolbase.h" #include #include "vector_string.h" // Case-insensitive string comparison, from Stroustrup's C++ third edition. // Works like strcmp(). -EXPCL_PANDA_PUTIL int cmp_nocase(const string &s, const string &s2); +EXPCL_DTOOL int cmp_nocase(const string &s, const string &s2); // Similar, except it also accepts hyphen and underscore as equivalent. -EXPCL_PANDA_PUTIL int cmp_nocase_uh(const string &s, const string &s2); +EXPCL_DTOOL int cmp_nocase_uh(const string &s, const string &s2); // Returns the string converted to lowercase. -EXPCL_PANDA_PUTIL string downcase(const string &s); +EXPCL_DTOOL string downcase(const string &s); // Returns the string converted to uppercase. -EXPCL_PANDA_PUTIL string upcase(const string &s); +EXPCL_DTOOL string upcase(const string &s); // Separates the string into words according to whitespace. -EXPCL_PANDA_PUTIL int extract_words(const string &str, vector_string &words); -EXPCL_PANDA_PUTIL int extract_words(const wstring &str, pvector &words); +EXPCL_DTOOL int extract_words(const string &str, vector_string &words); +EXPCL_DTOOL int extract_words(const wstring &str, pvector &words); // Separates the string into words according to the indicated delimiters. -EXPCL_PANDA_PUTIL void tokenize(const string &str, vector_string &words, +EXPCL_DTOOL void tokenize(const string &str, vector_string &words, const string &delimiters, bool discard_repeated_delimiters = false); -EXPCL_PANDA_PUTIL void tokenize(const wstring &str, pvector &words, +EXPCL_DTOOL void tokenize(const wstring &str, pvector &words, const wstring &delimiters, bool discard_repeated_delimiters = false); // Trims leading and/or trailing whitespace from the string. -EXPCL_PANDA_PUTIL string trim_left(const string &str); -EXPCL_PANDA_PUTIL wstring trim_left(const wstring &str); -EXPCL_PANDA_PUTIL string trim_right(const string &str); -EXPCL_PANDA_PUTIL wstring trim_right(const wstring &str); -EXPCL_PANDA_PUTIL string trim(const string &str); -EXPCL_PANDA_PUTIL wstring trim(const wstring &str); +EXPCL_DTOOL string trim_left(const string &str); +EXPCL_DTOOL wstring trim_left(const wstring &str); +EXPCL_DTOOL string trim_right(const string &str); +EXPCL_DTOOL wstring trim_right(const wstring &str); +EXPCL_DTOOL string trim(const string &str); +EXPCL_DTOOL wstring trim(const wstring &str); // Functions to parse numeric values out of a string. -EXPCL_PANDA_PUTIL int string_to_int(const string &str, string &tail); -EXPCL_PANDA_PUTIL bool string_to_int(const string &str, int &result); -EXPCL_PANDA_PUTIL double string_to_double(const string &str, string &tail); -EXPCL_PANDA_PUTIL bool string_to_double(const string &str, double &result); -EXPCL_PANDA_PUTIL bool string_to_float(const string &str, float &result); -EXPCL_PANDA_PUTIL bool string_to_stdfloat(const string &str, PN_stdfloat &result); +EXPCL_DTOOL int string_to_int(const string &str, string &tail); +EXPCL_DTOOL bool string_to_int(const string &str, int &result); +EXPCL_DTOOL double string_to_double(const string &str, string &tail); +EXPCL_DTOOL bool string_to_double(const string &str, double &result); +EXPCL_DTOOL bool string_to_float(const string &str, float &result); +EXPCL_DTOOL bool string_to_stdfloat(const string &str, PN_stdfloat &result); // Convenience function to make a string from anything that has an // ostream operator. diff --git a/panda/src/putil/Sources.pp b/panda/src/putil/Sources.pp index a3046d68fe..7e98890b70 100644 --- a/panda/src/putil/Sources.pp +++ b/panda/src/putil/Sources.pp @@ -63,7 +63,6 @@ pythonCallbackObject.h pythonCallbackObject.I \ simpleHashMap.I simpleHashMap.h \ sparseArray.I sparseArray.h \ - string_utils.I string_utils.N string_utils.h \ timedCycle.I timedCycle.h typedWritable.I \ typedWritable.h typedWritable_ext.h typedWritable_ext.cxx \ typedWritableReferenceCount.I \ @@ -113,7 +112,6 @@ pythonCallbackObject.cxx \ simpleHashMap.cxx \ sparseArray.cxx \ - string_utils.cxx \ timedCycle.cxx typedWritable.cxx \ typedWritableReferenceCount.cxx updateSeq.cxx \ uniqueIdAllocator.cxx \ @@ -175,7 +173,6 @@ pythonCallbackObject.h pythonCallbackObject.I \ simpleHashMap.I simpleHashMap.h \ sparseArray.I sparseArray.h \ - string_utils.I string_utils.h \ timedCycle.I timedCycle.h typedWritable.I \ typedWritable.h typedWritable_ext.h typedWritableReferenceCount.I \ typedWritableReferenceCount.h updateSeq.I updateSeq.h \ diff --git a/panda/src/putil/p3putil_composite2.cxx b/panda/src/putil/p3putil_composite2.cxx index 256accfc64..9cae69467c 100644 --- a/panda/src/putil/p3putil_composite2.cxx +++ b/panda/src/putil/p3putil_composite2.cxx @@ -17,7 +17,6 @@ #include "pythonCallbackObject.cxx" #include "simpleHashMap.cxx" #include "sparseArray.cxx" -#include "string_utils.cxx" #include "timedCycle.cxx" #include "typedWritable.cxx" #include "typedWritableReferenceCount.cxx"