vcfstring.h

来自「这是VCF框架的代码」· C头文件 代码 · 共 1,240 行 · 第 1/3 页

H
1,240
字号
	size_type find_first_of(const UniChar *s, size_type pos, size_type n) const  {		return data_.find_first_of( s, pos, n );	}	size_type find_first_of(const AnsiChar *s, size_type pos = 0) const;	size_type find_first_of(const UniChar *s, size_type pos = 0) const {		return data_.find_first_of( s, pos );	}	size_type find_first_of(AnsiChar c, size_type pos = 0) const ;	size_type find_first_of(UniChar c, size_type pos = 0) const {		return data_.find_first_of( c, pos );	}	size_type find_last_of(const UnicodeString& str, size_type pos = npos) const {		return data_.find_last_of( str.data_, pos );	}	size_type find_last_of(const AnsiChar *s, size_type pos, size_type n = npos) const;	size_type find_last_of(const UniChar *s, size_type pos, size_type n = npos) const {		return data_.find_last_of( s, pos, n );	}	size_type find_last_of(const AnsiChar *s, size_type pos = npos) const;	size_type find_last_of(const UniChar *s, size_type pos = npos) const {		return data_.find_last_of( s, pos );	}	size_type find_last_of(AnsiChar c, size_type pos = npos) const;	size_type find_last_of(UniChar c, size_type pos = npos) const  {		return data_.find_last_of( c, pos );	}	size_type find_first_not_of(const UnicodeString& str, size_type pos = 0) const {		return data_.find_first_not_of( str.data_, pos );	}	size_type find_first_not_of(const AnsiChar *s, size_type pos, size_type n) const;	size_type find_first_not_of(const UniChar *s, size_type pos, size_type n) const  {		return data_.find_first_not_of( s, pos, n );	}	size_type find_first_not_of(const AnsiChar *s, size_type pos = 0) const;	size_type find_first_not_of(const UniChar *s, size_type pos = 0) const {		return data_.find_first_not_of( s, pos );	}	size_type find_first_not_of(AnsiChar c, size_type pos = 0) const;	size_type find_first_not_of(UniChar c, size_type pos = 0) const  {		return data_.find_first_not_of( c, pos );	}	size_type find_last_not_of(const UnicodeString& str, size_type pos = npos) const  {		return data_.find_last_not_of( str.data_, pos );	}	size_type find_last_not_of(const AnsiChar *s, size_type pos, size_type n) const;	size_type find_last_not_of(const UniChar *s, size_type pos, size_type n) const {		return data_.find_last_not_of( s, pos, n );	}	size_type find_last_not_of(const AnsiChar *s, size_type pos = npos) const;	size_type find_last_not_of(const UniChar *s, size_type pos = npos) const {		return data_.find_last_not_of( s, pos );	}	size_type find_last_not_of(AnsiChar c, size_type pos = npos) const;	size_type find_last_not_of(UniChar c, size_type pos = npos) const {		return data_.find_last_not_of( c, pos );	}	UnicodeString substr(size_type pos = 0, size_type n = npos) const  {		return data_.substr( pos, n );	}	int compare(const UnicodeString& str) const {		return data_.compare( str.data_ );	}	int compare(size_type p0, size_type n0, const UnicodeString& str){		return data_.compare( p0, n0, str.data_ );	}	int compare(size_type p0, size_type n0, const UnicodeString& str, size_type pos, size_type n) {		return data_.compare( p0, n0, str.data_, pos, n );	}	int compare(const AnsiChar *s) const;	int compare(const UniChar *s) const {		return data_.compare( s );	}	int compare(size_type p0, size_type n0, const AnsiChar *s) const;	int compare(size_type p0, size_type n0, const UniChar *s) const {		return data_.compare( p0, n0, s );	}	int compare(size_type p0, size_type n0, const AnsiChar *s, size_type pos) const;	int compare(size_type p0, size_type n0, const UniChar *s, size_type pos) const {		return data_.compare( p0, n0, s, pos );	}	static void transformAnsiToUnicode( const AnsiChar* str, size_type stringLength, StringData& newStr );	static AnsiChar* transformUnicodeToAnsi( const UnicodeString& str );	static UniChar transformAnsiCharToUnicodeChar( AnsiChar c );	static AnsiChar transformUnicodeCharToAnsiChar( UniChar c );	static int adjustForBOMMarker( AnsiChar*& stringPtr, uint32& len );protected:	StringData data_;	mutable AnsiChar* ansiDataBuffer_;	void modified() {		if ( NULL != ansiDataBuffer_ ) {			delete [] ansiDataBuffer_;			ansiDataBuffer_ = NULL;		}	}	};inline UnicodeString operator +( const UnicodeString& lhs, const UnicodeString& rhs ){	UnicodeString result (lhs);	result += rhs;	return result;}inline UnicodeString operator +( const UnicodeString::UniChar* lhs, const UnicodeString& rhs ){	UnicodeString result(lhs) ;	result += rhs;	return result;}inline UnicodeString operator +( const UnicodeString& lhs, const UnicodeString::UniChar* rhs ){	UnicodeString result(lhs) ;	result += rhs;	return result;}inline UnicodeString operator +( const UnicodeString::UniChar& lhs, const UnicodeString& rhs ){	UnicodeString result(1,lhs) ;	result += rhs;	return result;}inline UnicodeString operator +( const UnicodeString& lhs, const UnicodeString::UniChar& rhs ){	UnicodeString result(lhs) ;	result += rhs;	return result;}inline UnicodeString operator +( const UnicodeString::AnsiChar& lhs, const UnicodeString& rhs ){	UnicodeString result(1,UnicodeString::transformAnsiCharToUnicodeChar( lhs ));	result += rhs;	return result;}inline UnicodeString operator +( const UnicodeString& lhs, const UnicodeString::AnsiChar& rhs ){	UnicodeString result(lhs);	result += UnicodeString::transformAnsiCharToUnicodeChar( rhs  );	return result;}inline UnicodeString operator +( const UnicodeString::AnsiChar* lhs, const UnicodeString& rhs ){	UnicodeString result;	UnicodeString::transformAnsiToUnicode( lhs, strlen(lhs), result );	result += rhs;	return result;}inline UnicodeString operator +( const UnicodeString& lhs, const UnicodeString::AnsiChar* rhs ){	UnicodeString result(lhs);	UnicodeString tmp;	UnicodeString::transformAnsiToUnicode( rhs, strlen(rhs), tmp );	result += tmp;	return result;}inline bool operator ==( const UnicodeString& lhs, const UnicodeString& rhs ){	return lhs.data_ == rhs.data_;}inline bool operator !=( const UnicodeString& lhs, const UnicodeString& rhs ){	return lhs.data_ != rhs.data_;}inline bool operator <( const UnicodeString& lhs, const UnicodeString& rhs ){	return lhs.data_ < rhs.data_;}inline bool operator <=( const UnicodeString& lhs, const UnicodeString& rhs ){	return lhs.data_ <= rhs.data_;}inline bool operator >( const UnicodeString& lhs, const UnicodeString& rhs ){	return lhs.data_ > rhs.data_;}inline bool operator >=( const UnicodeString& lhs, const UnicodeString& rhs ){	return lhs.data_ >= rhs.data_;}//typedef std::basic_string<VCFChar> String;typedef UnicodeString String;};/***CVS Log info*$Log$*Revision 1.5  2006/04/07 02:35:36  ddiego*initial checkin of merge from 0.6.9 dev branch.**Revision 1.4.2.6  2006/03/26 22:37:35  ddiego*minor update to source docs.**Revision 1.4.2.5  2006/03/12 22:01:44  ddiego*doc updates.**Revision 1.4.2.4  2005/11/30 05:31:36  ddiego*further osx drag-drop updates.**Revision 1.4.2.3  2005/11/10 02:02:38  ddiego*updated the osx build so that it*compiles again on xcode 1.5. this applies to the foundationkit and graphicskit.**Revision 1.4.2.2  2005/09/08 03:16:58  ddiego*fix for BOM marker in input stream handling and xml parser.**Revision 1.4.2.1  2005/07/30 16:57:34  iamfraggle*Fix operator < overloads for AnsiChar and UniChar**Revision 1.4  2005/07/09 23:15:06  ddiego*merging in changes from devmain-0-6-7 branch.**Revision 1.3.2.6  2005/04/13 02:53:11  iamfraggle*Remove inadvertantly added 'inline'**Revision 1.3.2.5  2005/04/11 22:47:58  marcelloptr*minor fix**Revision 1.3.2.4  2005/04/11 17:07:14  iamfraggle*Changes allowing compilation of Win32 port under CodeWarrior**Revision 1.3.2.3  2005/02/16 05:09:33  ddiego*bunch o bug fixes and enhancements to the property editor and treelist control.**Revision 1.3.2.2  2005/01/17 18:04:55  marcelloptr*removed unnecessary dllimport/dllexport keyword before global functions defined in the header*which was causing problems with the inline keyword. Thank you Fraggle for pointing out and solving this.**Revision 1.3  2004/12/01 04:31:41  ddiego*merged over devmain-0-6-6 code. Marcello did a kick ass job*of fixing a nasty bug (1074768VCF application slows down modal dialogs.)*that he found. Many, many thanks for this Marcello.**Revision 1.2.2.4  2004/09/18 16:54:55  ddiego*added a new function to the UnicodeString class to convert from a*unicode char to a ansi char.**Revision 1.2.2.3  2004/09/11 22:55:45  ddiego*changed the way ansi_c_str() works and got rid of global static map of allocated char* strings. This was causing problems on SMP machines.**Revision 1.2.2.2  2004/09/11 19:16:36  ddiego*changed the way ansi_c_str() works and got rid of global static map of allocated char* strings. This was causing problems on SMP machines.**Revision 1.2.2.1  2004/08/19 16:39:29  marcelloptr*Preparation of the UnicodeString class to accept a custom allocator. Added missed conversion and assignement operators.**Revision 1.2  2004/08/07 02:49:15  ddiego*merged in the devmain-0-6-5 branch to stable**Revision 1.1.2.8  2004/06/06 05:50:11  marcelloptr*added binary friend operators to UnicodeString**Revision 1.1.2.6  2004/05/30 01:36:01  marcelloptr*tabs reformatting**Revision 1.1.2.5  2004/05/16 02:39:10  ddiego*OSX code updates**Revision 1.1.2.4  2004/05/03 03:44:53  ddiego*This checks in a bunch of changes to the FoundationKit for OSX*porting. The thread, mutex, semaphor, condition, and file peers*have all been implemented and tested. The file peer could be improved*and needs search functionality. The locale peer is only partially*complete, but the functions will return values. The unicode transition*is also finished and works OK now.**Revision 1.1.2.3  2004/04/30 05:44:34  ddiego*added OSX changes for unicode migration**Revision 1.1.2.2  2004/04/29 04:07:13  marcelloptr*reformatting of source files: macros and csvlog and copyright sections**Revision 1.1.2.1  2004/04/28 03:29:41  ddiego*migration towards new directory structure**Revision 1.9.2.2  2004/04/26 21:58:49  marcelloptr*changes for dir reorganization: _VCF_MACRO_H__**Revision 1.9.2.1  2004/04/21 02:17:24  ddiego*checking in change to FoundationKit, GraphicsKit and Application*Kit to support unicode in Win32**Revision 1.9  2004/04/03 15:48:42  ddiego*Merged over code from the 0-6-3 branch.**Revision 1.8.2.3  2004/03/31 03:55:53  ddiego*fixed link problems with UnicodeString**Revision 1.8.2.2  2004/02/21 03:27:08  ddiego*updates for OSX porting**Revision 1.8.2.1  2004/02/15 20:24:01  ddiego*intial Locales implementation is now checked in. This adds several new classes, namely:*The LocalePeer, which is the OS generic peer for interfacing with teh OS for lcoale support*The Locale class which provides locale support for the vcf*The Win32LocalePeer which provides a basic Win32 implementation for locale support*The UnicodeString class, which is a near identical class to the std::string class and provides a wrapper around a std::basic_string<wchar_t>. This also adds support for translating to and from ansi strings, and supporting text encoding via a TextEncoder class.*The TextCodec class which allows for custom text codec for encoding or decoding text.*The MessageLoader class which is used to provide localized string translation*The StringsMessageLoader which provides a basic implementation of string loading and translation that is compatible with Apples .strings resource files.**Revision 1.8  2003/12/18 05:15:59  ddiego*merge from devmain-0-6-2 branch into the stable branch**Revision 1.7.20.1  2003/10/23 04:24:52  ddiego*more musical chairs with headers again, in yet another attempt to make*them more efficent to speed up compiles.*Removed all teh template RTTI classes and put them all in one header*called VCFRTTIImpl.h. This should help compile speeds a bit.*The next step is to look at some of the event classes and remove ones*that aren't really neccessary - I'd estimate that 50% of the current*event classes are unneccessary and can be removed.**Revision 1.7  2002/05/09 03:10:43  ddiego*merged over code from development branch devmain-0-5-1a into the main CVS trunk**Revision 1.6.4.1  2002/03/20 21:56:56  zzack*Changed Include Style of FoundationKit**Revision 1.6  2002/01/24 01:46:49  ddiego*added a cvs "log" comment to the top of all files in vcf/src and vcf/include*to facilitate change tracking**/#endif // _VCF_VCFSTRING_H__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?