📄 xmlstring.hpp
字号:
* @param ch The character to search within the string * @return If found, returns the index of the character within the string, * else returns -1. */ static int indexOf(const XMLCh* const toSearch, const XMLCh ch); /** * Provides the index of the first occurance of a character within a string * starting from a given index * * @param toSearch The string to search * @param chToFind The character to search within the string * @param fromIndex The index to start earch from * @return If found, returns the index of the character within the string, * else returns -1. */ static int indexOf ( const char* const toSearch , const char chToFind , const unsigned int fromIndex , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Provides the index of the first occurance of a character within a string * starting from a given index * * @param toSearch The string to search * @param chToFind The character to search within the string * @param fromIndex The index to start search from * @return If found, returns the index of the character within the string, * else returns -1. */ static int indexOf ( const XMLCh* const toSearch , const XMLCh chToFind , const unsigned int fromIndex , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Provides the index of the last occurance of a character within a string * * @param toSearch The string to search * @param ch The character to search within the string * @return If found, returns the index of the character within the string, * else returns -1. */ static int lastIndexOf(const char* const toSearch, const char ch); /** * Provides the index of the last occurance of a character within a string * * @param toSearch The string to search * @param ch The character to search within the string * @return If found, returns the index of the character within the string, * else returns -1. */ static int lastIndexOf(const XMLCh* const toSearch, const XMLCh ch); /** * Provides the index of the last occurance of a character within a string * * @param ch The character to search within the string * @param toSearch The string to search * @param toSearchLen The length of the string to search * @return If found, returns the index of the character within the string, * else returns -1. */ static int lastIndexOf ( const XMLCh ch , const XMLCh* const toSearch , const unsigned int toSearchLen ); /** * Provides the index of the last occurance of a character within a string * starting backward from a given index * * @param toSearch The string to search * @param chToFind The character to search within the string * @param fromIndex The index to start backward search from * @return If found, returns the index of the character within the string, * else returns -1. */ static int lastIndexOf ( const char* const toSearch , const char chToFind , const unsigned int fromIndex , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** * Provides the index of the last occurance of a character within a string * starting backward from a given index * * @param toSearch The string to search * @param ch The character to search within the string * @param fromIndex The index to start backward search from * @return If found, returns the index of the character within the string, * else returns -1. */ static int lastIndexOf ( const XMLCh* const toSearch , const XMLCh ch , const unsigned int fromIndex , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** @name Fixed size string movement */ //@{ /** Moves X number of chars * @param targetStr The string to copy the chars to * @param srcStr The string to copy the chars from * @param count The number of chars to move */ static void moveChars ( XMLCh* const targetStr , const XMLCh* const srcStr , const unsigned int count ); //@} /** @name Substring function */ //@{ /** Create a substring of a givend string. The substring begins at the * specified beginIndex and extends to the character at index * endIndex - 1. * @param targetStr The string to copy the chars to * @param srcStr The string to copy the chars from * @param startIndex beginning index, inclusive. * @param endIndex the ending index, exclusive. */ static void subString ( char* const targetStr , const char* const srcStr , const int startIndex , const int endIndex , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); /** Create a substring of a givend string. The substring begins at the * specified beginIndex and extends to the character at index * endIndex - 1. * @param targetStr The string to copy the chars to * @param srcStr The string to copy the chars from * @param startIndex beginning index, inclusive. * @param endIndex the ending index, exclusive. */ static void subString ( XMLCh* const targetStr , const XMLCh* const srcStr , const int startIndex , const int endIndex , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); //@} /** @name Replication function */ //@{ /** Replicates a string * NOTE: The returned buffer is dynamically allocated and is the * responsibility of the caller to delete it when not longer needed. * You can call XMLString::release to release this returned buffer. * * @param toRep The string to replicate * @return Returns a pointer to the replicated string * @see XMLString::release(char**) */ static char* replicate(const char* const toRep); /** Replicates a string * NOTE: The returned buffer is allocated with the MemoryManager. It is the * responsibility of the caller to delete it when not longer needed. * * @param toRep The string to replicate * @param manager The MemoryManager to use to allocate the string * @return Returns a pointer to the replicated string */ static char* replicate(const char* const toRep, MemoryManager* const manager); /** Replicates a string * NOTE: The returned buffer is dynamically allocated and is the * responsibility of the caller to delete it when not longer needed. * You can call XMLString::release to release this returned buffer. * @param toRep The string to replicate * @return Returns a pointer to the replicated string * @see XMLString::release(XMLCh**) */ static XMLCh* replicate(const XMLCh* const toRep); /** Replicates a string * NOTE: The returned buffer is allocated with the MemoryManager. It is the * responsibility of the caller to delete it when not longer needed. * * @param toRep The string to replicate * @param manager The MemoryManager to use to allocate the string * @return Returns a pointer to the replicated string */ static XMLCh* replicate(const XMLCh* const toRep, MemoryManager* const manager); //@} /** @name String query function */ //@{ /** Tells if the sub-string appears within a string at the beginning * @param toTest The string to test * @param prefix The sub-string that needs to be checked * @return Returns true if the sub-string was found at the beginning of * <code>toTest</code>, else false */ static bool startsWith ( const char* const toTest , const char* const prefix ); /** Tells if the sub-string appears within a string at the beginning * @param toTest The string to test * @param prefix The sub-string that needs to be checked * @return Returns true if the sub-string was found at the beginning of * <code>toTest</code>, else false */ static bool startsWith ( const XMLCh* const toTest , const XMLCh* const prefix ); /** Tells if the sub-string appears within a string at the beginning * without regard to case * * @param toTest The string to test * @param prefix The sub-string that needs to be checked * @return Returns true if the sub-string was found at the beginning of * <code>toTest</code>, else false */ static bool startsWithI ( const char* const toTest , const char* const prefix ); /** Tells if the sub-string appears within a string at the beginning * without regard to case * * @param toTest The string to test * @param prefix The sub-string that needs to be checked * * @return Returns true if the sub-string was found at the beginning * of <code>toTest</code>, else false */ static bool startsWithI ( const XMLCh* const toTest , const XMLCh* const prefix ); /** Tells if the sub-string appears within a string at the end. * @param toTest The string to test * @param suffix The sub-string that needs to be checked * @return Returns true if the sub-string was found at the end of * <code>toTest</code>, else false */ static bool endsWith ( const XMLCh* const toTest , const XMLCh* const suffix ); /** Tells if a string has any occurance of any character of another * string within itself * @param toSearch The string to be searched * @param searchList The string from which characters to be searched for are drawn * @return Returns the pointer to the location where the first occurrence of any * character from searchList is found, * else returns 0 */ static const XMLCh* findAny ( const XMLCh* const toSearch , const XMLCh* const searchList ); /** Tells if a string has any occurance of any character of another * string within itself * @param toSearch The string to be searched * @param searchList The string from which characters to be searched for are drawn * @return Returns the pointer to the location where the first occurrence of any * character from searchList is found, * else returns 0 */ static XMLCh* findAny ( XMLCh* const toSearch , const XMLCh* const searchList ); /** Tells if a string has pattern within itself * @param toSearch The string to be searched * @param pattern The pattern to be located within the string * @return Returns index to the location where the pattern was * found, else returns -1 */ static int patternMatch ( const XMLCh* const toSearch , const XMLCh* const pattern ); /** Get the length of the string * @param src The string whose length is to be determined * @return Returns the length of the string */ static unsigned int stringLen(const char* const src); /** Get the length of the string * @param src The string whose length is to be determined * @return Returns the length of the string */ static unsigned int stringLen(const XMLCh* const src); /** * Deprecated: please use XMLChar1_0::isValidNCName * * Checks whether an name is a valid NCName according to XML 1.0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -