⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addonprofile.cpp

📁 一个调试STL的VC插件
💻 CPP
字号:
#include "stdafx.h"

#pragma warning( disable : 4786 )

#include <string>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <queue>
#include <deque>
#include <stack>

#include <comutil.h>
#include <atlbase.h>

typedef std::string string;

// map types
typedef std::map<long, string>    TLongStr;
typedef std::map<string, string > TStrStr;
typedef std::map<long, long>      TLongLong;

// multimap types
typedef std::multimap<long, string>   TMLongStr;
typedef std::multimap<long, long>     TMLongLong;
typedef std::multimap<string, string> TMStrStr;

// vector types
typedef std::vector<string> TVStr;
typedef std::vector<long>   TVLong;

// list types
typedef std::list<string> TLStr;
typedef std::list<long>   TLLong;

// set
typedef std::set<long>        TSLong;
typedef std::set<string>      TSStr;
typedef std::multiset<long>   TMsLong;
typedef std::multiset<string> TMsStr;


#define DEF_TEST_STRING "ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n\t\v\b"
#define STR_DEF_TEST  string( DEF_TEST_STRING )

int main( int argc, char* argv[] )
{
  char buffer[ 8192 ];
  
  // maps
  TLongLong   mapLL;  TLongStr    mapLS;  TStrStr     mapSS;
  TMLongLong  mmapLL; TMLongStr   mmapLS; TMStrStr    mmapSS;

  // list, vector
  TLLong      listL;  TLStr       listS;
  TVStr       vecS;   TVLong      vecL;

  // set, multiset
  TSLong      setL;   TSStr      setS;
  TMsLong     msetL;  TMsStr      msetS;

  string    strValue = DEF_TEST_STRING;

  for( int j=0; j<10; j++ )
    strValue += strValue;

  const char * czBuffTestLongVariableNamesWithSomething = strValue.c_str( );
  CString   cstrClass = czBuffTestLongVariableNamesWithSomething;
  CComBSTR  combstr = cstrClass;  
  BSTR      bstr = combstr;
  bstr_t    TBstr = bstr;

  for( long i = 0; i<4000; i++ )
  {
    sprintf( buffer, "%04d - ABCDEFGHIJKLMNOPQRSTUVWXYZ" , i );
    string temp = buffer;

    mapLL.insert( TLongLong::value_type( i, i+1 ) );
    mapLS.insert( TLongStr::value_type( i, temp ) );
    mapSS.insert( TStrStr::value_type( temp, temp ) );

    mmapLL.insert( TMLongLong::value_type( i, i+1 ) );
    mmapLL.insert( TMLongLong::value_type( i, i ) );
    mmapLS.insert( TMLongStr::value_type( i, temp ) );
    mmapLS.insert( TMLongStr::value_type( i, temp ) );
    mmapSS.insert( TMStrStr::value_type( temp, temp ) );
    mmapSS.insert( TMStrStr::value_type( temp, temp ) );

    listL.push_back( i );
    listS.push_back( temp );
    vecL.push_back( i );
    vecS.push_back( temp );
    
    setL.insert( i );
    setS.insert( temp );
    
    msetL.insert( i );
    msetL.insert( i );

    msetS.insert( temp );
    msetS.insert( temp );
  }

  return 0;
}

⌨️ 快捷键说明

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