Commit Graph

85 Commits

Author SHA1 Message Date
paulc c4c9e994f0 Renamed DebugGoOn to DebugCrit so it better matches its purpose.
Swapped order of DebugCall and DebugNote so DebugCall is less visible.
Changed default debug level to DebugNote.
Modified a few inadequate uses of DebugCrit.


git-svn-id: http://yate.null.ro/svn/yate/trunk@6250 acf43c95-373e-0410-b603-e72c3f656dc1
2017-08-01 13:08:23 +00:00
paulc cdba9c103b Added method for URI escaping an entire list of characters.
Escape status detail characters that may disturb status parsing.


git-svn-id: http://yate.null.ro/svn/yate/trunk@6184 acf43c95-373e-0410-b603-e72c3f656dc1
2017-02-16 11:24:25 +00:00
marian 5e18aa85f8 Added Regexp flag used to avoid regexp re-compile if not changed. Removed valid() method.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6099 acf43c95-373e-0410-b603-e72c3f656dc1
2016-03-04 10:24:01 +00:00
marian d6ffcbd0a9 Fixed bug: check vsnprintf result in String::printf(). Update held string length after printf.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6071 acf43c95-373e-0410-b603-e72c3f656dc1
2015-11-24 15:58:55 +00:00
paulc 4c0a8e31c9 Made String::printf(const char* format, ...) grow with the format string length.
The helper function string_printf is now static.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5963 acf43c95-373e-0410-b603-e72c3f656dc1
2015-03-23 15:37:43 +00:00
marian b19d0a8e8e Added String constructor from double. Added assignment and append operators from double.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5962 acf43c95-373e-0410-b603-e72c3f656dc1
2015-03-19 13:11:45 +00:00
andrei c7a98797a2 Clear the string if we failed to obtain the 'printf" formatted one.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5961 acf43c95-373e-0410-b603-e72c3f656dc1
2015-03-16 11:39:37 +00:00
andrei 8ef9679c3d Added a better description and more suggestive parameters for String::appendFixed method.
Clear the String in 'printf' method if 'malloc' fails.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5960 acf43c95-373e-0410-b603-e72c3f656dc1
2015-03-13 16:03:42 +00:00
andrei ca3a15437c Added printf style format method for String.
Added utility method to append and align a string on a specified size.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5959 acf43c95-373e-0410-b603-e72c3f656dc1
2015-03-13 13:25:35 +00:00
oana a9fa6b1bd0 Add function to the String API for locating the last instance of a substring in a string.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5916 acf43c95-373e-0410-b603-e72c3f656dc1
2014-10-16 12:34:11 +00:00
paulc ce97d09aa4 Made static String::hash() capable of incremental hashing.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5859 acf43c95-373e-0410-b603-e72c3f656dc1
2014-07-02 07:30:37 +00:00
paulc 37a72e4bc1 Added copyright notices to sources and scripts missing them.
Updated copyright notices for 2014.
Fixed end of lines in many files.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5755 acf43c95-373e-0410-b603-e72c3f656dc1
2014-02-05 11:42:17 +00:00
paulc b34147802a SQL escape single quote by doubling it instead of preceding with backslash.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5630 acf43c95-373e-0410-b603-e72c3f656dc1
2013-08-27 19:31:18 +00:00
paulc 18ff43d395 Fixed 64 bit types usage in Javascript, was broken on 32 bit machines.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5612 acf43c95-373e-0410-b603-e72c3f656dc1
2013-08-07 09:49:52 +00:00
paulc c371a7037c Separated 32 and 64 bit constructors and assignments for String.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5611 acf43c95-373e-0410-b603-e72c3f656dc1
2013-08-06 15:42:44 +00:00
paulc cf5d0fd71a Changed license terms in each source file to reference an external file.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5609 acf43c95-373e-0410-b603-e72c3f656dc1
2013-08-06 13:38:10 +00:00
paulc d3379766f5 Added class to handle Unicode characters and their UTF-8 conversions.
Made String handling of UTF-8 and Unicode easier.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5507 acf43c95-373e-0410-b603-e72c3f656dc1
2013-05-20 15:00:26 +00:00
paulc 3b49b78ecb Added a shared static list of Atom strings and an YATOM macro.
This speeds up signifficantly the Yate RTTI on compilers that HAVE_BLOCK_RETURN.
Made the String comparison operator inline to shave off a few cycles.
Fast handle the comparison in identity case.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5449 acf43c95-373e-0410-b603-e72c3f656dc1
2013-04-12 13:19:14 +00:00
oana 70be0d0fdd Optimized String::msgEscape() and String::msgUnescape() functions.
Added String::append(const char* value, int len) function to the API.
Inlined String::operator+=(const char* value) to use the new String::append() API function.



git-svn-id: http://yate.null.ro/svn/yate/trunk@5436 acf43c95-373e-0410-b603-e72c3f656dc1
2013-04-12 12:39:04 +00:00
oana 9382df168e Slight optimization of String operator += by replacing the use of strncat with strncpy.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5412 acf43c95-373e-0410-b603-e72c3f656dc1
2013-02-15 16:20:37 +00:00
oana 08f9aae41b Changed declaration of String::hash() to inline function.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5406 acf43c95-373e-0410-b603-e72c3f656dc1
2013-02-14 14:29:41 +00:00
paulc 082d93a3a3 Reduce complexity of appending multiple objects to a list.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5271 acf43c95-373e-0410-b603-e72c3f656dc1
2012-09-19 10:59:42 +00:00
paulc bb063cb563 Added String method that converts to long integer.
git-svn-id: http://yate.null.ro/svn/yate/trunk@4899 acf43c95-373e-0410-b603-e72c3f656dc1
2012-02-13 08:27:48 +00:00
paulc f04d08edb8 Fixed meaning of parameter: clump -> clamp.
git-svn-id: http://yate.null.ro/svn/yate/trunk@4563 acf43c95-373e-0410-b603-e72c3f656dc1
2011-08-23 15:47:01 +00:00
marian 57bff41ad4 String to integer conversion can now check the result against allowed min/max values. Use it in sip module.
git-svn-id: http://yate.null.ro/svn/yate/trunk@4562 acf43c95-373e-0410-b603-e72c3f656dc1
2011-08-23 15:14:28 +00:00
paulc fa0269ba4f New YSTRING macro that creates an ad-hoc static const String to speed up comparations and conversions from literal strings.
On unsupported compilers the literal string is returned unchanged.


git-svn-id: http://yate.null.ro/svn/yate/trunk@4423 acf43c95-373e-0410-b603-e72c3f656dc1
2011-06-03 12:26:53 +00:00
paulc a6bb5eea55 Added methods to extract a fragment of a String up to a separator.
git-svn-id: http://yate.null.ro/svn/yate/trunk@4229 acf43c95-373e-0410-b603-e72c3f656dc1
2011-03-28 16:18:45 +00:00
marian 92c4fe2c60 Optimized String append from ObjList: calculate required space, allocate it and then build the new string.
git-svn-id: http://yate.null.ro/svn/yate/trunk@3811 acf43c95-373e-0410-b603-e72c3f656dc1
2010-11-12 16:34:26 +00:00
paulc 1779a3b154 Made the private pointer of Regexp mutable so compile() and matches() can be made const.
Part of a patch by Allan Sandfeld Jensen.


git-svn-id: http://yate.null.ro/svn/yate/trunk@3390 acf43c95-373e-0410-b603-e72c3f656dc1
2010-06-17 11:36:52 +00:00
paulc 616e868e00 Use the sdbm string hashing algorithm from http://www.cse.yorku.ca/~oz/hash.html
Patch recommended by Allan Sandfeld Jensen.


git-svn-id: http://yate.null.ro/svn/yate/trunk@3372 acf43c95-373e-0410-b603-e72c3f656dc1
2010-06-11 12:29:00 +00:00
paulc d95cb2fec6 Spelling cleanup of a very common error: Retrive -> Retrieve
git-svn-id: http://yate.null.ro/svn/yate/trunk@3371 acf43c95-373e-0410-b603-e72c3f656dc1
2010-06-11 11:25:10 +00:00
paulc a43d4619fc Use the * precision specification in sprintf to allow format checks.
git-svn-id: http://yate.null.ro/svn/yate/trunk@3147 acf43c95-373e-0410-b603-e72c3f656dc1
2010-03-26 09:41:42 +00:00
paulc 53bd36d6b9 Improved checking of String appending during race conditions.
git-svn-id: http://yate.null.ro/svn/yate/trunk@3137 acf43c95-373e-0410-b603-e72c3f656dc1
2010-03-22 12:15:46 +00:00
paulc 1e06cd8aba Fortify String appending against concurrency conditions so the resulting string is at most garbled or truncated.
It was possible to overwrite arbitrary amounts of memory if the String itself or the appended value were modified during the appending operation.


git-svn-id: http://yate.null.ro/svn/yate/trunk@3133 acf43c95-373e-0410-b603-e72c3f656dc1
2010-03-22 11:30:24 +00:00
paulc 2d27ec675c Precompile regular expressions on construction from constant string so it won't need to compile on first call.
git-svn-id: http://yate.null.ro/svn/yate/trunk@3046 acf43c95-373e-0410-b603-e72c3f656dc1
2010-01-31 20:05:43 +00:00
paulc 655783fb6b String::uriEscape() takes an extra optional parameter with characters that should not be escaped, for specific cases when a protocol makes some characters unreserved.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2816 acf43c95-373e-0410-b603-e72c3f656dc1
2009-09-01 14:32:00 +00:00
paulc 65fa4adbd4 Fixed warnings and a few minor bugs when compiling on a different architecture.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2724 acf43c95-373e-0410-b603-e72c3f656dc1
2009-06-19 11:19:20 +00:00
paulc 9b292f5868 Fixed some warnings and genuine bugs exposed by newer gcc.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2447 acf43c95-373e-0410-b603-e72c3f656dc1
2009-01-20 12:27:53 +00:00
paulc 9aa7bb2325 Added new String method trimSpaces.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2403 acf43c95-373e-0410-b603-e72c3f656dc1
2008-12-19 14:16:53 +00:00
paulc 6e24d52c38 Added static empty instances of ObjList and NamedList.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2280 acf43c95-373e-0410-b603-e72c3f656dc1
2008-10-22 13:32:25 +00:00
marian 6184ff5849 Fixed bug: String descendants are now calling the parent's changed() method to allow the String to update its data.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2049 acf43c95-373e-0410-b603-e72c3f656dc1
2008-07-02 14:49:21 +00:00
paulc 7e180c38aa Added UTF-8 fixing and overlongs detection.
git-svn-id: http://yate.null.ro/svn/yate/trunk@1995 acf43c95-373e-0410-b603-e72c3f656dc1
2008-05-26 11:09:24 +00:00
paulc 2d82c82e91 Added methods to get the length of an UTF-8 string, can be used for validation.
git-svn-id: http://yate.null.ro/svn/yate/trunk@1994 acf43c95-373e-0410-b603-e72c3f656dc1
2008-05-23 17:21:28 +00:00
marian 5cf0a5b127 Added the NamedPointer class. Add NamedString::getObject()
git-svn-id: http://yate.null.ro/svn/yate/trunk@1641 acf43c95-373e-0410-b603-e72c3f656dc1
2008-01-17 15:31:48 +00:00
paulc 60b4dcd7a5 Fixed possible integer truncation when converting Strings to integers.
Added local helper strtoi() that deals with the problem.


git-svn-id: http://yate.null.ro/svn/yate/trunk@1463 acf43c95-373e-0410-b603-e72c3f656dc1
2007-10-29 17:51:45 +00:00
paulc 5d899f2c36 Accept "t" and "f" as boolean representations, helps in SQL conversions.
git-svn-id: http://yate.null.ro/svn/yate/trunk@1448 acf43c95-373e-0410-b603-e72c3f656dc1
2007-09-01 15:04:29 +00:00
paulc ade53f8424 Fixed String::msgUnescape to always unescape "%z" as ":" since msgEscape
always escapes the other way around.


git-svn-id: http://yate.null.ro/svn/yate/trunk@1369 acf43c95-373e-0410-b603-e72c3f656dc1
2007-06-21 12:47:56 +00:00
paulc 20e1728c4f New String::append methods that join back an ObjList.
git-svn-id: http://yate.null.ro/svn/yate/trunk@1234 acf43c95-373e-0410-b603-e72c3f656dc1
2007-03-26 18:18:22 +00:00
paulc 0a5434061a Fixed a signedness bug in character comparation.
git-svn-id: http://yate.null.ro/svn/yate/trunk@986 acf43c95-373e-0410-b603-e72c3f656dc1
2006-08-03 17:49:31 +00:00
paulc 5f3116ebc9 Added extra methods to String
git-svn-id: http://yate.null.ro/svn/yate/trunk@833 acf43c95-373e-0410-b603-e72c3f656dc1
2006-06-03 16:08:48 +00:00