亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? string.h

?? pe exe packer (must use vc2005 to compile)
?? H
字號:
// Common/String.h

#ifndef __COMMON_STRING_H
#define __COMMON_STRING_H

#include <string.h>
// #include <wchar.h>

#include "Vector.h"

#ifdef _WIN32
#include "MyWindows.h"
#endif

static const char *kTrimDefaultCharSet  = " \n\t";

template <class T>
inline int MyStringLen(const T *s)
{ 
  int i;
  for (i = 0; s[i] != '\0'; i++);
  return i;
}

template <class T>
inline T * MyStringCopy(T *dest, const T *src)
{ 
  T *destStart = dest;
  while((*dest++ = *src++) != 0);
  return destStart;
}

inline wchar_t* MyStringGetNextCharPointer(wchar_t *p)
  { return (p + 1); }
inline const wchar_t* MyStringGetNextCharPointer(const wchar_t *p)
  { return (p + 1); }
inline wchar_t* MyStringGetPrevCharPointer(const wchar_t *, wchar_t *p)
  { return (p - 1); }
inline const wchar_t* MyStringGetPrevCharPointer(const wchar_t *, const wchar_t *p)
  { return (p - 1); }

#ifdef _WIN32

inline char* MyStringGetNextCharPointer(char *p)
  { return CharNextA(p); }
inline const char* MyStringGetNextCharPointer(const char *p)
  { return CharNextA(p); }

inline char* MyStringGetPrevCharPointer(char *base, char *p)
  { return CharPrevA(base, p); }
inline const char* MyStringGetPrevCharPointer(const char *base, const char *p)
  { return CharPrevA(base, p); }

inline char MyCharUpper(char c)
  { return (char)(unsigned int)CharUpperA((LPSTR)(unsigned int)(unsigned char)c); }
#ifdef _UNICODE
inline wchar_t MyCharUpper(wchar_t c)
  { return (wchar_t)CharUpperW((LPWSTR)c); }
#else
wchar_t MyCharUpper(wchar_t c);
#endif

inline char MyCharLower(char c)
  { return (char)(unsigned int)CharLowerA((LPSTR)(unsigned int)(unsigned char)c); }
#ifdef _UNICODE
inline wchar_t MyCharLower(wchar_t c)
  { return (wchar_t)CharLowerW((LPWSTR)c); }
#else
wchar_t MyCharLower(wchar_t c);
#endif

inline char * MyStringUpper(char *s) { return CharUpperA(s); }
#ifdef _UNICODE
inline wchar_t * MyStringUpper(wchar_t *s) { return CharUpperW(s); }
#else
wchar_t * MyStringUpper(wchar_t *s);
#endif

inline char * MyStringLower(char *s) { return CharLowerA(s); }
#ifdef _UNICODE
inline wchar_t * MyStringLower(wchar_t *s) { return CharLowerW(s); }
#else
wchar_t * MyStringLower(wchar_t *s);
#endif

#else // Standard-C
wchar_t MyCharUpper(wchar_t c);
#endif

//////////////////////////////////////
// Compare

/*
#ifndef _WIN32_WCE
int MyStringCollate(const char *s1, const char *s2);
int MyStringCollateNoCase(const char *s1, const char *s2);
#endif
int MyStringCollate(const wchar_t *s1, const wchar_t *s2);
int MyStringCollateNoCase(const wchar_t *s1, const wchar_t *s2);
*/

int MyStringCompare(const char *s1, const char  *s2);
int MyStringCompare(const wchar_t *s1, const wchar_t *s2);

#ifdef _WIN32
int MyStringCompareNoCase(const char *s1, const char  *s2);
#endif

int MyStringCompareNoCase(const wchar_t *s1, const wchar_t *s2);

template <class T>
class CStringBase
{
  void TrimLeftWithCharSet(const CStringBase &charSet)
  {
    const T *p = _chars;
    while (charSet.Find(*p) >= 0 && (*p != 0))
      p = GetNextCharPointer(p);
    Delete(0, (int)(p - _chars));
  }
  void TrimRightWithCharSet(const CStringBase &charSet)
  {
    const T *p = _chars;
    const T *pLast = NULL;
    while (*p != 0)
    {
      if (charSet.Find(*p) >= 0)
      {
        if (pLast == NULL)
          pLast = p;
      }
      else
        pLast = NULL;
      p = GetNextCharPointer(p);
    }
    if(pLast != NULL)
    {
      int i = (int)(pLast - _chars);
      Delete(i, _length - i);
    }

  }
  void MoveItems(int destIndex, int srcIndex)
  {
    memmove(_chars + destIndex, _chars + srcIndex, 
        sizeof(T) * (_length - srcIndex + 1));
  }
  
  void InsertSpace(int &index, int size)
  {
    CorrectIndex(index);
    GrowLength(size);
    MoveItems(index + size, index);
  }

  static T *GetNextCharPointer(T *p)
    { return MyStringGetNextCharPointer(p); }
  static const T *GetNextCharPointer(const T *p)
    { return MyStringGetNextCharPointer(p); }
  static T *GetPrevCharPointer(T *base, T *p)
    { return MyStringGetPrevCharPointer(base, p); }
  static const T *GetPrevCharPointer(const T *base, const T *p)
    { return MyStringGetPrevCharPointer(base, p); }
protected:
  T *_chars;
  int _length;
	int _capacity;
  
  void SetCapacity(int newCapacity)
  {
    int realCapacity = newCapacity + 1;
    if(realCapacity == _capacity)
      return;
    /*
    const int kMaxStringSize = 0x20000000;
    #ifndef _WIN32_WCE
    if(newCapacity > kMaxStringSize || newCapacity < _length)
      throw 1052337;
    #endif
    */
    T *newBuffer = new T[realCapacity];
    if(_capacity > 0)
    {
      for (int i = 0; i < (_length + 1); i++)
        newBuffer[i] = _chars[i];
      delete []_chars;
      _chars = newBuffer;
    }
    else
    {
      _chars = newBuffer;
      _chars[0] = 0;
    }
    _capacity = realCapacity;
  }

  void GrowLength(int n)
  {
    int freeSize = _capacity - _length - 1;
    if (n <= freeSize) 
      return;
    int delta;
    if (_capacity > 64)
      delta = _capacity / 2;
    else if (_capacity > 8)
      delta = 16;
    else
      delta = 4;
    if (freeSize + delta < n)
      delta = n - freeSize;
    SetCapacity(_capacity + delta);
  }

  void CorrectIndex(int &index) const
  {
    if (index > _length)
      index = _length;
  }

public:
  CStringBase(): _chars(0), _length(0), _capacity(0)
    { SetCapacity(16 - 1); }
  CStringBase(T c):  _chars(0), _length(0), _capacity(0)
  {
    SetCapacity(1);
    _chars[0] = c;
    _chars[1] = 0;
    _length = 1;
  }
  CStringBase(const T *chars): _chars(0), _length(0), _capacity(0)
  {
    int length = MyStringLen(chars);
    SetCapacity(length);
    MyStringCopy(_chars, chars); // can be optimized by memove()
    _length = length;
  }
  CStringBase(const CStringBase &s):  _chars(0), _length(0), _capacity(0)
  {
    SetCapacity(s._length);
    MyStringCopy(_chars, s._chars);
    _length = s._length;
  }
  ~CStringBase() {  delete []_chars; }

  operator const T*() const { return _chars;} 

  // The minimum size of the character buffer in characters. 
  // This value does not include space for a null terminator.
  T* GetBuffer(int minBufLength)
  {
    if(minBufLength >= _capacity)
      SetCapacity(minBufLength + 1);
    return _chars;
  }
  void ReleaseBuffer() { ReleaseBuffer(MyStringLen(_chars)); }
  void ReleaseBuffer(int newLength)
  {
    /*
    #ifndef _WIN32_WCE
    if(newLength >= _capacity)
      throw 282217;
    #endif
    */
    _chars[newLength] = 0;
    _length = newLength;
  }

  CStringBase& operator=(T c)
  {
    Empty();
    SetCapacity(1);
    _chars[0] = c;
    _chars[1] = 0;
    _length = 1;
    return *this;
  }
  CStringBase& operator=(const T *chars)
  {
    Empty();
    int length = MyStringLen(chars);
    SetCapacity(length);
    MyStringCopy(_chars, chars);
    _length = length; 
    return *this;
  }  
  CStringBase& operator=(const CStringBase& s)
  {
    if(&s == this)
      return *this;
    Empty();
    SetCapacity(s._length);
    MyStringCopy(_chars, s._chars);
    _length = s._length;
    return *this;
  }
  
  CStringBase& operator+=(T c)
  {
    GrowLength(1);
    _chars[_length] = c;
    _chars[++_length] = 0;
    return *this;
  }
  CStringBase& operator+=(const T *s)
  {
    int len = MyStringLen(s);
    GrowLength(len);
    MyStringCopy(_chars + _length, s);
    _length += len;
    return *this;
  }
  CStringBase& operator+=(const CStringBase &s)
  {
    GrowLength(s._length);
    MyStringCopy(_chars + _length, s._chars);
    _length += s._length;
    return *this;
  }
  void Empty()
  {
    _length = 0;
    _chars[0] = 0;
  }
  int Length() const { return _length; }
  bool IsEmpty() const { return (_length == 0); }

  CStringBase Mid(int startIndex) const
    { return Mid(startIndex, _length - startIndex); }
  CStringBase Mid(int startIndex, int count ) const
  {
    if (startIndex + count > _length)
      count = _length - startIndex;
    
    if (startIndex == 0 && startIndex + count == _length)
      return *this;
    
    CStringBase<T> result;
    result.SetCapacity(count);
    // MyStringNCopy(result._chars, _chars + startIndex, count);
    for (int i = 0; i < count; i++)
      result._chars[i] = _chars[startIndex + i];
    result._chars[count] = 0;
    result._length = count;
    return result;
  }
  CStringBase Left(int count) const
    { return Mid(0, count); }
  CStringBase Right(int count) const
  {
    if (count > _length)
      count = _length;
    return Mid(_length - count, count);
  }

  void MakeUpper()
    { MyStringUpper(_chars); }
  void MakeLower()
    { MyStringLower(_chars); }

  int Compare(const CStringBase& s) const
    { return MyStringCompare(_chars, s._chars); }

  int CompareNoCase(const CStringBase& s) const
    { return MyStringCompareNoCase(_chars, s._chars); }
  /*
  int Collate(const CStringBase& s) const
    { return MyStringCollate(_chars, s._chars); }
  int CollateNoCase(const CStringBase& s) const
    { return MyStringCollateNoCase(_chars, s._chars); }
  */

  int Find(T c) const { return Find(c, 0); }
  int Find(T c, int startIndex) const
  {
    T *p = _chars + startIndex;
    while (true)
    {
      if (*p == c)
        return (int)(p - _chars);
      if (*p == 0)
        return -1;
      p = GetNextCharPointer(p);
    }
  }
  int Find(const CStringBase &s) const { return Find(s, 0); }
  int Find(const CStringBase &s, int startIndex) const
  {
    if (s.IsEmpty())
      return startIndex;
    for (; startIndex < _length; startIndex++)
    {
      int j;
      for (j = 0; j < s._length && startIndex + j < _length; j++)
        if (_chars[startIndex+j] != s._chars[j])
          break;
      if (j == s._length)
        return startIndex;
    }
    return -1;
  }
  int ReverseFind(T c) const
  {
    if (_length == 0)
      return -1;
    T *p = _chars + _length - 1;
    while (true)
    {
      if (*p == c)
        return (int)(p - _chars);
      if (p == _chars)
        return -1;
      p = GetPrevCharPointer(_chars, p);
    }
  }
  int FindOneOf(const CStringBase &s) const
  {
    for(int i = 0; i < _length; i++)
      if (s.Find(_chars[i]) >= 0)
        return i;
      return -1;
  }

  void TrimLeft(T c)
  {
    const T *p = _chars;
    while (c == *p)
      p = GetNextCharPointer(p);
    Delete(0, p - _chars);
  }
  private:
  CStringBase GetTrimDefaultCharSet()
  {
    CStringBase<T> charSet;
    for(int i = 0; i < (int)(sizeof(kTrimDefaultCharSet) /
      sizeof(kTrimDefaultCharSet[0])); i++)
      charSet += (T)kTrimDefaultCharSet[i];
    return charSet;
  }
  public:

  void TrimLeft()
  {
    TrimLeftWithCharSet(GetTrimDefaultCharSet());
  }
  void TrimRight()
  {
    TrimRightWithCharSet(GetTrimDefaultCharSet());
  }
  void TrimRight(T c)
  {
    const T *p = _chars;
    const T *pLast = NULL;
    while (*p != 0)
    {
      if (*p == c)
      {
        if (pLast == NULL)
          pLast = p;
      }
      else
        pLast = NULL;
      p = GetNextCharPointer(p);
    }
    if(pLast != NULL)
    {
      int i = pLast - _chars;
      Delete(i, _length - i);
    }
  }
  void Trim()
  {
    TrimRight();
    TrimLeft();
  }

  int Insert(int index, T c)
  {
    InsertSpace(index, 1);
    _chars[index] = c;
    _length++;
    return _length;
  }
  int Insert(int index, const CStringBase &s)
  {
    CorrectIndex(index);
    if (s.IsEmpty())
      return _length;
    int numInsertChars = s.Length();
    InsertSpace(index, numInsertChars);
    for(int i = 0; i < numInsertChars; i++)
      _chars[index + i] = s[i];
    _length += numInsertChars;
    return _length;
  }

  // !!!!!!!!!!!!!!! test it if newChar = '\0'
  int Replace(T oldChar, T newChar)
  {
    if (oldChar == newChar)
      return 0;
    int number  = 0;
    int pos  = 0;
    while (pos < Length())
    {
      pos = Find(oldChar, pos);
      if (pos < 0) 
        break;
      _chars[pos] = newChar;
      pos++;
      number++;
    }
    return number;
  }
  int Replace(const CStringBase &oldString, const CStringBase &newString)
  {
    if (oldString.IsEmpty())
      return 0;
    if (oldString == newString)
      return 0;
    int oldStringLength = oldString.Length();
    int newStringLength = newString.Length();
    int number  = 0;
    int pos  = 0;
    while (pos < _length)
    {
      pos = Find(oldString, pos);
      if (pos < 0) 
        break;
      Delete(pos, oldStringLength);
      Insert(pos, newString);
      pos += newStringLength;
      number++;
    }
    return number;
  }
  int Delete(int index, int count = 1 )
  {
    if (index + count > _length)
      count = _length - index;
    if (count > 0)
    {
      MoveItems(index, index + count);
      _length -= count;
    }
    return _length;
  }
};

template <class T>
CStringBase<T> operator+(const CStringBase<T>& s1, const CStringBase<T>& s2)
{
  CStringBase<T> result(s1);
  result += s2;
  return result; 
}

template <class T>
CStringBase<T> operator+(const CStringBase<T>& s, T c)
{
  CStringBase<T> result(s);
  result += c;
  return result; 
}

template <class T>
CStringBase<T> operator+(T c, const CStringBase<T>& s)
{
  CStringBase<T> result(c);
  result += s;
  return result; 
}

template <class T>
CStringBase<T> operator+(const CStringBase<T>& s, const T * chars)
{
  CStringBase<T> result(s);
  result += chars;
  return result; 
}

template <class T>
CStringBase<T> operator+(const T * chars, const CStringBase<T>& s)
{
  CStringBase<T> result(chars);
  result += s;
  return result; 
}

template <class T>
bool operator==(const CStringBase<T>& s1, const CStringBase<T>& s2)
  { return (s1.Compare(s2) == 0); }

template <class T>
bool operator<(const CStringBase<T>& s1, const CStringBase<T>& s2)
  { return (s1.Compare(s2) < 0); }

template <class T>
bool operator==(const T *s1, const CStringBase<T>& s2)
  { return (s2.Compare(s1) == 0); }

template <class T>
bool operator==(const CStringBase<T>& s1, const T *s2)
  { return (s1.Compare(s2) == 0); }

template <class T>
bool operator!=(const CStringBase<T>& s1, const CStringBase<T>& s2)
  { return (s1.Compare(s2) != 0); }

template <class T>
bool operator!=(const T *s1, const CStringBase<T>& s2)
  { return (s2.Compare(s1) != 0); }

template <class T>
bool operator!=(const CStringBase<T>& s1, const T *s2)
  { return (s1.Compare(s2) != 0); }

typedef CStringBase<char> AString;
typedef CStringBase<wchar_t> UString;

typedef CObjectVector<AString> AStringVector;
typedef CObjectVector<UString> UStringVector;

#ifdef _UNICODE
  typedef UString CSysString;
#else
  typedef AString CSysString;
#endif

typedef CObjectVector<CSysString> CSysStringVector;

#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
2020日本不卡一区二区视频| 国产欧美日本一区二区三区| 蜜桃av一区二区三区电影| 欧美日韩一级黄| 日本成人在线网站| 精品欧美一区二区在线观看| 国内精品免费**视频| 国产亚洲精品7777| 91亚洲国产成人精品一区二三 | 欧美一区二区视频观看视频| 日本不卡123| 国产日韩精品久久久| 91蜜桃免费观看视频| 日韩精品久久理论片| 久久久99久久| 色综合天天综合网天天看片| 亚洲mv在线观看| 久久网站最新地址| 99re成人精品视频| 日韩黄色小视频| 中文字幕av一区二区三区| 欧美亚洲综合一区| 麻豆精品久久精品色综合| 国产精品免费aⅴ片在线观看| 在线一区二区三区| 精品一区二区三区在线播放视频| 国产精品另类一区| 69久久夜色精品国产69蝌蚪网| 国产专区欧美精品| 亚洲自拍偷拍欧美| 久久色成人在线| 在线观看三级视频欧美| 久久99精品久久久久久国产越南| 国产精品夫妻自拍| 制服丝袜亚洲精品中文字幕| 成人综合在线观看| 肉丝袜脚交视频一区二区| 国产日韩欧美综合一区| 欧美性生交片4| 国产精品一区二区91| 亚洲一区视频在线| 一区二区三区在线视频免费 | 91精品国产一区二区三区香蕉| 国产一区视频在线看| 一级特黄大欧美久久久| 欧美精品一区二区精品网| 91久久国产最好的精华液| 国产一区欧美二区| 亚洲成人自拍一区| 中文字幕中文乱码欧美一区二区| 在线成人av影院| av电影天堂一区二区在线| 中文字幕佐山爱一区二区免费| 成人免费av资源| 天堂蜜桃91精品| 中文欧美字幕免费| 日韩一区二区电影在线| 一道本成人在线| 国产精品2024| 青青草原综合久久大伊人精品优势| 最新不卡av在线| 国产亚洲精品免费| 日韩欧美中文字幕精品| 在线观看免费亚洲| 成人性生交大片免费看视频在线| 日本成人中文字幕在线视频| 一区二区三区国产精品| 国产欧美日韩综合| 精品国产乱码久久久久久浪潮 | 欧美精品123区| 99国产精品国产精品毛片| 国产精品一二三在| 美国av一区二区| 日韩精彩视频在线观看| 一二三区精品视频| 综合欧美亚洲日本| 中文字幕国产一区| 国产婷婷色一区二区三区| 日韩片之四级片| 欧美精品少妇一区二区三区| 一本久道久久综合中文字幕| av在线播放一区二区三区| 国产精品一二三在| 国产伦精一区二区三区| 精一区二区三区| 美女久久久精品| 秋霞电影网一区二区| 亚洲一区二区五区| 一区二区三区中文字幕| 亚洲人成在线播放网站岛国| 中文字幕第一页久久| 国产欧美日韩麻豆91| 国产亚洲精品资源在线26u| 精品国一区二区三区| 日韩天堂在线观看| 日韩欧美国产一区二区在线播放| 欧美日韩国产片| 欧美肥胖老妇做爰| 在线不卡免费av| 欧美高清视频在线高清观看mv色露露十八| 91精品1区2区| 欧美性大战久久久| 欧美私人免费视频| 欧美日韩一本到| 欧美日韩一区成人| 欧美日韩aaaaa| 欧美三级乱人伦电影| 欧美三级电影在线看| 欧美日韩高清一区二区三区| 欧美视频一区在线| 欧美三级一区二区| 欧美精选一区二区| 欧美一卡二卡在线| 亚洲精品一区二区在线观看| 久久久久久毛片| 国产视频一区在线播放| 国产精品天美传媒| 日韩一区在线看| 亚洲精品国产高清久久伦理二区| 亚洲激情校园春色| 亚洲成人av电影在线| 日韩电影在线免费看| 久久99久久99| 国产福利一区二区三区视频在线| 丁香婷婷综合网| 色综合中文字幕国产 | 欧美曰成人黄网| 欧美日韩亚州综合| 5月丁香婷婷综合| 欧美一区二区三区四区视频| 精品日韩在线观看| 国产欧美久久久精品影院| 亚洲天堂精品在线观看| 亚洲国产另类av| 日本不卡1234视频| 国产剧情一区在线| 99精品欧美一区二区三区综合在线| 色噜噜狠狠色综合中国| 欧美无砖砖区免费| 日韩欧美国产综合一区| 国产亚洲婷婷免费| 亚洲日本在线a| 三级久久三级久久| 国产高清久久久久| 日本精品视频一区二区| 欧美另类变人与禽xxxxx| 欧美mv日韩mv国产网站| 国产日韩欧美精品在线| 亚洲色图制服诱惑| 日本中文字幕不卡| 国产高清成人在线| 色综合天天狠狠| 欧美一区二区三区在线观看 | 亚洲一区二区欧美| 蜜乳av一区二区| 成人性生交大片免费看在线播放 | 欧美一区二区三区视频在线| 国产视频一区不卡| 亚洲最新视频在线观看| 精品在线播放免费| 色视频欧美一区二区三区| 日韩三级av在线播放| 国产精品成人一区二区三区夜夜夜| 亚洲国产中文字幕| 国产精品白丝jk黑袜喷水| 欧美性生活一区| 国产日韩欧美一区二区三区乱码| 亚洲午夜久久久久中文字幕久| 国内精品嫩模私拍在线| 欧洲人成人精品| 国产三级精品三级| 日韩国产一二三区| 99久久久久久| 日韩女同互慰一区二区| 亚洲免费av观看| 国产麻豆午夜三级精品| 欧美中文字幕一区| 久久久久久电影| 午夜久久电影网| proumb性欧美在线观看| 欧美变态tickle挠乳网站| 亚洲女人小视频在线观看| 国内久久精品视频| 欧美日韩国产综合一区二区| 国产精品免费丝袜| 亚洲婷婷综合久久一本伊一区| 日本v片在线高清不卡在线观看| 久久99精品国产麻豆婷婷洗澡| 色偷偷成人一区二区三区91| 久久久久久日产精品| 丝袜诱惑制服诱惑色一区在线观看| 成人午夜激情在线| 欧美一级夜夜爽| 夜夜嗨av一区二区三区四季av| 国产高清亚洲一区| 日韩你懂的在线观看| 亚洲大片精品永久免费| 99久久免费视频.com| 久久综合网色—综合色88| 无码av免费一区二区三区试看|