]> git.ipfire.org Git - thirdparty/squid.git/commit
Add string API layer for better string handling.
authoramosjeffries <>
Fri, 18 May 2007 12:41:21 +0000 (12:41 +0000)
committeramosjeffries <>
Fri, 18 May 2007 12:41:21 +0000 (12:41 +0000)
commit86c0aed6f3d6225d2769d5eee25eb4d1d7eb1e44
tree4841a71cde766bd7189ff7c6b4b515bff9830b7e
parentb8da3ec119f9a8d5f91421704534cf6acbad82f3
Add string API layer for better string handling.

For various reasons listed below we adopt the std::string API (but not the implementation) as the basis for string operations.

This patch reverts the SquidString.h file to provide only the main API and hooks for any string implementation behind the API.

For Release 3.0 the old String (now SqString) will remain the default string core.
That code has been kept in this patch with some minor modifications and bug fixes as listed below.

For Release 3.1 it is expected that a better string core will be developed.

Reasons for these changes:

The initial String implementation was incomplete and non-standard causing some risky operations at points in the code and duplicated some operations.
std::string provides a better known API for string handling which is widely use amongst other string implementations beyond std::string itself and this enables std::string or a derivative to be used in squid at some future date.
String as used previously is a defined alternative to std::string in some systems

This patch:
   - moves the old String class to SqString
   - provides the well-known type of 'string' for general use
   - provides implicit conversion from char* and char[] types
   - migrates custom functions to well-known API:
       buf()           -> c_str()
       clean()         -> clear()
   - removes redundant functions:
       buf(char*)      -> operator=(char*)
       initBuf(char*)  -> operator=(char*)
       reset(char*)    -> operator=(char*)
   - adds well-known API methods for safer string use:
       operator []
       empty()
       operator <<
       strcmp(), strcasecmp(), etc
   - May fix bug #1088 - segmentation fault after append(char*,int)
   - Fixes several unreported char* handling bugs in String/SqString
112 files changed:
ChangeLog
src/ACLExtUser.cc
src/ACLHTTPHeaderData.cc
src/ACLHTTPHeaderData.h
src/ACLUrlPath.cc
src/AuthUser.cc
src/CommonPool.h
src/CompositePoolNode.h
src/ConfigParser.h
src/DelayBucket.cc
src/DelayTagged.cc
src/DelayTagged.h
src/DiskIO/AIO/AIODiskFile.h
src/ESI.cc
src/ESIAssign.cc
src/ESIAssign.h
src/ESICustomParser.cc
src/ESICustomParser.h
src/ESISegment.cc
src/ESIVarState.cc
src/ESIVarState.h
src/ExternalACLEntry.h
src/HttpHdrCc.cc
src/HttpHdrRange.cc
src/HttpHdrSc.cc
src/HttpHdrSc.h
src/HttpHdrScTarget.cc
src/HttpHdrScTarget.h
src/HttpHeader.cc
src/HttpHeader.h
src/HttpHeaderRange.h
src/HttpHeaderTools.cc
src/HttpReply.cc
src/HttpReply.h
src/HttpRequest.cc
src/HttpRequest.h
src/HttpStatusLine.cc
src/HttpStatusLine.h
src/ICAP/ICAPConfig.cc
src/ICAP/ICAPConfig.h
src/ICAP/ICAPModXact.cc
src/ICAP/ICAPOptXact.cc
src/ICAP/ICAPOptions.cc
src/ICAP/ICAPOptions.h
src/ICAP/ICAPServiceRep.cc
src/ICAP/ICAPServiceRep.h
src/ICAP/ICAPXaction.cc
src/Makefile.am
src/MemObject.cc
src/PeerDigest.h
src/SquidString.h
src/Store.h
src/StoreHashIndex.h
src/String.cc
src/String.cci
src/SwapDir.cc
src/SwapDir.h
src/access_log.cc
src/auth/digest/auth_digest.cc
src/auth/negotiate/auth_negotiate.cc
src/auth/ntlm/auth_ntlm.cc
src/cache_cf.cc
src/client_db.cc
src/client_side.cc
src/client_side_reply.cc
src/client_side_request.cc
src/client_side_request.h
src/dns_internal.cc
src/errorpage.cc
src/external_acl.cc
src/fqdncache.cc
src/fs/coss/CossSwapDir.h
src/fs/coss/store_dir_coss.cc
src/fs/null/store_null.cc
src/fs/null/store_null.h
src/fs/ufs/store_dir_ufs.cc
src/fs/ufs/ufscommon.h
src/ftp.cc
src/gopher.cc
src/http.cc
src/ident.cc
src/internal.cc
src/ipcache.cc
src/net_db.cc
src/pconn.cc
src/peer_digest.cc
src/protos.h
src/redirect.cc
src/stat.cc
src/store.cc
src/store_dir.cc
src/store_log.cc
src/structs.h
src/tests/CapturingStoreEntry.h
src/tests/TestSwapDir.cc
src/tests/TestSwapDir.h
src/tests/testCacheManager.cc
src/tests/testEvent.cc
src/tests/testHttpRequest.cc
src/tests/testHttpRequestMethod.cc
src/tests/testStore.cc
src/tests/testStore.h
src/tests/testStoreController.cc
src/tests/testStoreEntryStream.cc
src/tests/testStoreHashIndex.cc
src/tests/testString.cc
src/tests/testString.h
src/tests/testURLScheme.cc
src/tests/test_http_range.cc
src/url.cc
src/urn.cc
src/whois.cc