Commit Graph

67 Commits

Author SHA1 Message Date
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
paulc cda2d9f1c2 Updated copyright and FSF address.
git-svn-id: http://yate.null.ro/svn/yate/trunk@815 acf43c95-373e-0410-b603-e72c3f656dc1
2006-05-27 15:08:43 +00:00
paulc b1e52e95f5 Added system usage class and uptime command.
git-svn-id: http://yate.null.ro/svn/yate/trunk@807 acf43c95-373e-0410-b603-e72c3f656dc1
2006-05-24 10:04:22 +00:00
paulc ceb2ed78ee Added URI escape methods and using them in URI parsing.
git-svn-id: http://yate.null.ro/svn/yate/trunk@796 acf43c95-373e-0410-b603-e72c3f656dc1
2006-05-18 15:22:55 +00:00
paulc 4fb35c4015 Added the case-insensitive startSkip almost in the form suggested by Olaf Conradi.
Added methods for converting a String or Configuration entry to double.


git-svn-id: http://yate.null.ro/svn/yate/trunk@711 acf43c95-373e-0410-b603-e72c3f656dc1
2006-03-13 20:28:34 +00:00
paulc b9b80f95a1 Fixed a minor warning on 64bit platforms.
git-svn-id: http://yate.null.ro/svn/yate/trunk@626 acf43c95-373e-0410-b603-e72c3f656dc1
2005-12-30 02:45:23 +00:00
paulc 112f8cc624 Fixed a bug in Regexp match.
Channel IDs are reported in debug messages.
A debug filter can be set on channels.


git-svn-id: http://yate.null.ro/svn/yate/trunk@596 acf43c95-373e-0410-b603-e72c3f656dc1
2005-12-09 21:33:10 +00:00
paulc abd96bee47 Separated database functions from register into separate driver.
git-svn-id: http://yate.null.ro/svn/yate/trunk@579 acf43c95-373e-0410-b603-e72c3f656dc1
2005-11-16 05:53:33 +00:00
paulc 8ad4bd1b78 Changed escaping of message strings to always escape colon.
Proper passing of SIP dialog tags to custom handlers.


git-svn-id: http://yate.null.ro/svn/yate/trunk@511 acf43c95-373e-0410-b603-e72c3f656dc1
2005-09-13 16:11:30 +00:00
paulc be9c3cabb4 Fixed DirectSound and OpenH323 modules for Windows.
git-svn-id: http://yate.null.ro/svn/yate/trunk@440 acf43c95-373e-0410-b603-e72c3f656dc1
2005-07-09 18:27:49 +00:00
paulc 0644fc3d34 Fixed authentication issues.
git-svn-id: http://yate.null.ro/svn/yate/trunk@387 acf43c95-373e-0410-b603-e72c3f656dc1
2005-06-04 00:06:59 +00:00
paulc ae1eecc562 Debugging related changes.
git-svn-id: http://yate.null.ro/svn/yate/trunk@336 acf43c95-373e-0410-b603-e72c3f656dc1
2005-05-06 18:13:33 +00:00
paulc b52a90a618 Updated copyright years, fixed %ll formatting.
git-svn-id: http://yate.null.ro/svn/yate/trunk@320 acf43c95-373e-0410-b603-e72c3f656dc1
2005-04-29 22:05:07 +00:00
paulc 11fedca824 Ported bugfixes and timestamps from 0.8
git-svn-id: http://yate.null.ro/svn/yate/trunk@304 acf43c95-373e-0410-b603-e72c3f656dc1
2005-04-22 20:07:26 +00:00
paulc 6fae685e7e no message
git-svn-id: http://yate.null.ro/svn/yate/trunk@294 acf43c95-373e-0410-b603-e72c3f656dc1
2005-04-14 03:14:20 +00:00
paulc 9459c52dcd *** empty log message ***
git-svn-id: http://yate.null.ro/svn/yate/trunk@284 acf43c95-373e-0410-b603-e72c3f656dc1
2005-04-10 21:52:31 +00:00
paulc d35d4d6b4a Separated non-engine related classes in their own include file.
git-svn-id: http://yate.null.ro/svn/yate/trunk@279 acf43c95-373e-0410-b603-e72c3f656dc1
2005-04-08 10:55:22 +00:00
paulc 49ff961c9a Fixed some bugs left from windows porting.
git-svn-id: http://yate.null.ro/svn/yate/trunk@273 acf43c95-373e-0410-b603-e72c3f656dc1
2005-04-02 13:28:14 +00:00
paulc 60ec9fec0b Added VC++6 projects and lots of porting changes
git-svn-id: http://yate.null.ro/svn/yate/trunk@272 acf43c95-373e-0410-b603-e72c3f656dc1
2005-04-02 00:49:38 +00:00