📄 pstring_8h-source.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>pstring.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>pstring.h</h1><a href="pstring_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> * pstring.h</span>00003 <span class="comment"> *</span>00004 <span class="comment"> * Character string class.</span>00005 <span class="comment"> *</span>00006 <span class="comment"> * Portable Windows Library</span>00007 <span class="comment"> *</span>00008 <span class="comment"> * Copyright (c) 1993-1998 Equivalence Pty. Ltd.</span>00009 <span class="comment"> *</span>00010 <span class="comment"> * The contents of this file are subject to the Mozilla Public License</span>00011 <span class="comment"> * Version 1.0 (the "License"); you may not use this file except in</span>00012 <span class="comment"> * compliance with the License. You may obtain a copy of the License at</span>00013 <span class="comment"> * http://www.mozilla.org/MPL/</span>00014 <span class="comment"> *</span>00015 <span class="comment"> * Software distributed under the License is distributed on an "AS IS"</span>00016 <span class="comment"> * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See</span>00017 <span class="comment"> * the License for the specific language governing rights and limitations</span>00018 <span class="comment"> * under the License.</span>00019 <span class="comment"> *</span>00020 <span class="comment"> * The Original Code is Portable Windows Library.</span>00021 <span class="comment"> *</span>00022 <span class="comment"> * The Initial Developer of the Original Code is Equivalence Pty. Ltd.</span>00023 <span class="comment"> *</span>00024 <span class="comment"> * Portions are Copyright (C) 1993 Free Software Foundation, Inc.</span>00025 <span class="comment"> * All Rights Reserved.</span>00026 <span class="comment"> *</span>00027 <span class="comment"> * Contributor(s): ______________________________________.</span>00028 <span class="comment"> *</span>00029 <span class="comment"> * $Log: pstring.h,v $</span>00030 <span class="comment"> * Revision 1.78 2004/08/16 08:49:59 csoutheren</span>00031 <span class="comment"> * Removed error when compiling with gcc</span>00032 <span class="comment"> *</span>00033 <span class="comment"> * Revision 1.77 2004/08/16 06:40:59 csoutheren</span>00034 <span class="comment"> * Added adapters template to make device plugins available via the abstract factory interface</span>00035 <span class="comment"> *</span>00036 <span class="comment"> * Revision 1.76 2004/06/01 05:54:18 csoutheren</span>00037 <span class="comment"> * Added <vector> and <string></span>00038 <span class="comment"> *</span>00039 <span class="comment"> * Revision 1.75 2004/06/01 05:21:38 csoutheren</span>00040 <span class="comment"> * Added conversions between std::string and PString, and vector<PString> and PStringArray</span>00041 <span class="comment"> *</span>00042 <span class="comment"> * Revision 1.74 2004/05/04 11:10:36 rjongbloed</span>00043 <span class="comment"> * Fixed usage of MakeEmpty() with PStringStream.</span>00044 <span class="comment"> *</span>00045 <span class="comment"> * Revision 1.73 2004/04/18 04:33:36 rjongbloed</span>00046 <span class="comment"> * Changed all operators that return BOOL to return standard type bool. This is primarily</span>00047 <span class="comment"> * for improved compatibility with std STL usage removing many warnings.</span>00048 <span class="comment"> *</span>00049 <span class="comment"> * Revision 1.72 2004/04/11 13:26:25 csoutheren</span>00050 <span class="comment"> * Removed namespace problems and removed warnings for Windows <string></span>00051 <span class="comment"> *</span>00052 <span class="comment"> * Revision 1.71 2004/04/09 06:38:10 rjongbloed</span>00053 <span class="comment"> * Fixed compatibility with STL based streams, eg as used by VC++2003</span>00054 <span class="comment"> *</span>00055 <span class="comment"> * Revision 1.70 2004/04/09 03:42:34 csoutheren</span>00056 <span class="comment"> * Removed all usages of "virtual inline" and "inline virtual"</span>00057 <span class="comment"> *</span>00058 <span class="comment"> * Revision 1.69 2004/04/03 06:54:22 rjongbloed</span>00059 <span class="comment"> * Many and various changes to support new Visual C++ 2003</span>00060 <span class="comment"> *</span>00061 <span class="comment"> * Revision 1.68 2004/02/23 00:44:38 csoutheren</span>00062 <span class="comment"> * A completely different, other regex include hack to avoid requiring</span>00063 <span class="comment"> * the sources when using a header-file only environment</span>00064 <span class="comment"> *</span>00065 <span class="comment"> * Revision 1.67 2004/02/23 00:26:05 csoutheren</span>00066 <span class="comment"> * Finally, a generic and elegant fix for the regex include hacks. Thanks to Roger Hardiman</span>00067 <span class="comment"> *</span>00068 <span class="comment"> * Revision 1.66 2004/02/11 05:09:14 csoutheren</span>00069 <span class="comment"> * Fixed problems with regex libraries on Solaris, and with host OS numbering</span>00070 <span class="comment"> * being a quoted string rather than a number. Thanks to Chad Attermann</span>00071 <span class="comment"> * Fixed problems SSL detection problems thanks to Michal Zygmuntowicz</span>00072 <span class="comment"> *</span>00073 <span class="comment"> * Revision 1.65 2004/02/08 11:13:11 rjongbloed</span>00074 <span class="comment"> * Fixed crash in heavily loaded multi-threaded systems using simultaneous sorted</span>00075 <span class="comment"> * lists, Thanks Federico Pinna, Fabrizio Ammollo and the gang at Reitek S.p.A.</span>00076 <span class="comment"> *</span>00077 <span class="comment"> * Revision 1.64 2004/01/18 13:43:48 rjongbloed</span>00078 <span class="comment"> * Fixed broken PString::MakeEmpty() function and moved implementations to .inl file.</span>00079 <span class="comment"> *</span>00080 <span class="comment"> * Revision 1.63 2004/01/17 18:15:24 csoutheren</span>00081 <span class="comment"> * Fixed multi-threading problem with PString::Empty</span>00082 <span class="comment"> * Created PString::MakeEmpty for efficient emptying of existing strings</span>00083 <span class="comment"> *</span>00084 <span class="comment"> * Revision 1.62 2004/01/16 13:24:37 csoutheren</span>00085 <span class="comment"> * Changed PString::Empty to be thread-safe</span>00086 <span class="comment"> * Fixed PContainer::SetMinSize and PAbstractArray::SetSize, thanks to 123@call2ua.com</span>00087 <span class="comment"> * Fixed PString::FindLast, thanks to Andreas Sikkema</span>00088 <span class="comment"> *</span>00089 <span class="comment"> * Revision 1.61 2003/12/13 23:08:46 csoutheren</span>00090 <span class="comment"> * Changed PRegularExpression to allow a copy constructor and operator =</span>00091 <span class="comment"> *</span>00092 <span class="comment"> * Revision 1.60 2003/12/10 03:28:50 csoutheren</span>00093 <span class="comment"> * Removed compile time warning under Linux</span>00094 <span class="comment"> *</span>00095 <span class="comment"> * Revision 1.59 2003/12/07 05:50:49 csoutheren</span>00096 <span class="comment"> * Blocked operator = for PRegularExpression</span>00097 <span class="comment"> *</span>00098 <span class="comment"> * Revision 1.58 2003/12/04 13:10:38 csoutheren</span>00099 <span class="comment"> * Made PRegularExpression copy constructor private to avoid accidental usage (and subsequent crash)</span>00100 <span class="comment"> *</span>00101 <span class="comment"> * Revision 1.57 2003/05/14 00:46:47 rjongbloed</span>00102 <span class="comment"> * Added constructor to string lists/arrays etc that takes a single PString.</span>00103 <span class="comment"> *</span>00104 <span class="comment"> * Revision 1.56 2003/03/31 01:23:56 robertj</span>00105 <span class="comment"> * Added ReadFrom functions for standard container classes such as</span>00106 <span class="comment"> * PIntArray and PStringList etc</span>00107 <span class="comment"> *</span>00108 <span class="comment"> * Revision 1.55 2003/03/05 08:48:32 robertj</span>00109 <span class="comment"> * Added PStringArray::ToCharAray() function at suggestion of Ravelli Rossano</span>00110 <span class="comment"> *</span>00111 <span class="comment"> * Revision 1.54 2002/11/12 09:17:44 robertj</span>00112 <span class="comment"> * Added PString::NumCompare() as functional equivalent of strncmp().</span>00113 <span class="comment"> * Added PSortedStringList::GetNextStringsIndex() to do searches of binary</span>00114 <span class="comment"> * tree on partal strings.</span>00115 <span class="comment"> *</span>00116 <span class="comment"> * Revision 1.53 2002/10/31 05:53:44 robertj</span>00117 <span class="comment"> * Now comprehensively stated that a PString is ALWAYS an 8 bit string as</span>00118 <span class="comment"> * there are far too many inheerent assumptions every to make it 16 bit.</span>00119 <span class="comment"> * Added UTF-8/UCS-2 conversion functions to PString.</span>00120 <span class="comment"> *</span>00121 <span class="comment"> * Revision 1.52 2002/09/16 01:08:59 robertj</span>00122 <span class="comment"> * Added #define so can select if #pragma interface/implementation is used on</span>00123 <span class="comment"> * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.</span>00124 <span class="comment"> *</span>00125 <span class="comment"> * Revision 1.51 2002/08/14 00:43:39 robertj</span>00126 <span class="comment"> * Added ability to have fixed maximum length PStringStream's so does not do</span>00127 <span class="comment"> * unwanted malloc()'s while outputing data.</span>00128 <span class="comment"> *</span>00129 <span class="comment"> * Revision 1.50 2002/04/09 02:30:18 robertj</span>00130 <span class="comment"> * Removed GCC3 variable as __GNUC__ can be used instead, thanks jason Spence</span>00131 <span class="comment"> *</span>00132 <span class="comment"> * Revision 1.49 2002/02/15 04:29:31 robertj</span>00133 <span class="comment"> * Added PString::Empty() to return the primordial empty string. Saves on a</span>00134 <span class="comment"> * couple of memory allocations for every empty string ever used.</span>00135 <span class="comment"> *</span>00136 <span class="comment"> * Revision 1.48 2002/01/26 23:55:55 craigs</span>00137 <span class="comment"> * Changed for GCC 3.0 compatibility, thanks to manty@manty.net</span>00138 <span class="comment"> *</span>00139 <span class="comment"> * Revision 1.47 2002/01/22 01:03:57 craigs</span>00140 <span class="comment"> * Added operator += and operator + functions to PStringArray and PStringList</span>00141 <span class="comment"> * Added AppendString operator to PStringArray</span>00142 <span class="comment"> *</span>00143 <span class="comment"> * Revision 1.46 2001/10/17 05:09:22 robertj</span>00144 <span class="comment"> * Added contructors and assigmnent operators so integer types can be</span>00145 <span class="comment"> * automatically converted to strings.</span>00146 <span class="comment"> *</span>00147 <span class="comment"> * Revision 1.45 2001/08/11 07:57:30 rogerh</span>00148 <span class="comment"> * Add Mac OS Carbon changes from John Woods <jfw@jfwhome.funhouse.com></span>00149 <span class="comment"> *</span>00150 <span class="comment"> * Revision 1.44 2001/04/18 04:10:15 robertj</span>00151 <span class="comment"> * Removed hash function for caseless strings as confuses mixed dictionaries.</span>00152 <span class="comment"> *</span>00153 <span class="comment"> * Revision 1.43 2001/04/18 01:20:58 robertj</span>00154 <span class="comment"> * Fixed problem with hash function for short strings, thanks Patrick Koorevaar.</span>00155 <span class="comment"> * Also fixed hash function for caseless strings.</span>00156 <span class="comment"> *</span>00157 <span class="comment"> * Revision 1.42 2001/02/21 03:38:37 robertj</span>00158 <span class="comment"> * Added ability to copy between various string lists/arrays etc during construction.</span>00159 <span class="comment"> *</span>00160 <span class="comment"> * Revision 1.41 2001/02/13 04:39:08 robertj</span>00161 <span class="comment"> * Fixed problem with operator= in container classes. Some containers will</span>00162 <span class="comment"> * break unless the copy is virtual (eg PStringStream's buffer pointers) so</span>00163 <span class="comment"> * needed to add a new AssignContents() function to all containers.</span>00164 <span class="comment"> *</span>00165 <span class="comment"> * Revision 1.40 1999/08/22 12:13:43 robertj</span>00166 <span class="comment"> * Fixed warning when using inlines on older GNU compiler</span>00167 <span class="comment"> *</span>00168 <span class="comment"> * Revision 1.39 1999/05/28 14:01:22 robertj</span>00169 <span class="comment"> * Added initialisers to string containers (list, sorted list and set).</span>00170 <span class="comment"> *</span>00171 <span class="comment"> * Revision 1.38 1999/03/09 09:34:05 robertj</span>00172 <span class="comment"> * Fixed typo's.</span>00173 <span class="comment"> *</span>00174 <span class="comment"> * Revision 1.37 1999/03/09 02:59:50 robertj</span>00175 <span class="comment"> * Changed comments to doc++ compatible documentation.</span>00176 <span class="comment"> *</span>00177 <span class="comment"> * Revision 1.36 1999/02/16 08:11:09 robertj</span>00178 <span class="comment"> * MSVC 6.0 compatibility changes.</span>00179 <span class="comment"> *</span>00180 <span class="comment"> * Revision 1.35 1998/09/23 06:21:12 robertj</span>00181 <span class="comment"> * Added open source copyright license.</span>00182 <span class="comment"> *</span>00183 <span class="comment"> * Revision 1.34 1998/01/26 00:33:46 robertj</span>00184 <span class="comment"> * Added FindRegEx function to PString that returns position and length.</span>00185 <span class="comment"> * Added Execute() functions to PRegularExpression that take PINDEX references instead of PIntArrays.</span>00186 <span class="comment"> * Added static function to PRegularExpression to escape all special operator characters in a string.</span>00187 <span class="comment"> *</span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -