ToDo Cached Add-on for Visual C++

Add-on Screen shots:



Click here for larger image

Add-on find dialog:

Environment: Microsoft Visual C++ version 6.0

To-do cached add-on was designed to simplify developer’s tasks, like debugging and code management. As a result of my work a Visual Studio Add-on component was created. It makes some things easier.

Debugging Features

Main feature of Debugging is STL containers expanding. This add-on supports debugging of such STL containers:

  •      std::vector
  •      std::list
  •      std::map
  •      std::multimap
  •      std::set
  •      std::multiset

Also special debugging features were added they add support of very long strings to Visual C++ debugger. Add-on fixes Visual C++ Debugger limitation to string output. (Visual C++ debugger can show only 242 symbols of the string). This Add-on can expand very long strings (more than 65536 symbols):

  •      CString (MFC Class)
  •      std::string
  •      BSTR and WCHAR*
  •      bstr_t (COM support class)
  •      char *
  •      CComBSTR (ATL Class)

Add-on is also capable of showing XML long strings with user friendly formatting/indenting. It also supports quick find by simple string or RegExp (Regular Expressions). In Find Dialog any part of the string can be copied to the system clipboard for the future use of developer.

Code Management Features

Add-on has special features which can be used to manage Visual C++ project source code. In simple words it looks like:

Developer adds a comment with special signature, like: // TODO: after such keyword the task description could be written. Add-on can support as many keywords as developer wants. The main advantage of this Visual C++ add-on is that it parses comments. Add-on parses all comments in source code, checks commented strings for needed keywords and displays results. Add-on is capable of distinguishing comments of two types // - single line and /* - multi line comments. Each keyword used in Add-on must start from '//' or '/*' symbols - if you want to parse comments only, and from any other symbol if you want to parse full source code.

All Results of parsing are cached and updated when developer save changes to file. That is why add-on have name To-Do Cached. Results of its work are printed into Macro tab of output window. Find needed string in output window and make a double click on it to proceed to that string in your source code. Add-on also understands multi line comments written as a list of single line comments, example:

// TODO: -- start -- write code which do something special and with context and
// and continue work -- end --

Add-on will interpret such comment as a long one comment and will display it by one line. Results of work can be sorted and filtered.

 

Toolbar look's like:

 Show Results
This is a first button in toolbar (direction from left to right). Press this button to display results of keywords search in Macro tab of output window. It’s a pity but I still don’t know how to set active Macro tab on button press. That is why after press you must change tab to Macro manually.

 Reparse Workspace
 Press this button to free the cache of add-on. Needed only when there are too much files in workspace. Don’t open Option dialog after that– according to add-on logic, it will have to parse the workspace again to display statistics.

 Options Dialog
Some of the add-on’s features can be configured using Option Dialog.

 Tabify all files
On press add-on will automatically open all files in active project and change all spaces in files to tabs.

 Untabify all files
Reverse process of Tabify action. Add-on will open all files of active project and change all tabs to spaces.

 STL Debug Dialog
Open STL Debug Dialog of add-on. On button press add-on will try to locate variable in currently opened source file by selection or by cursor position.

 

Example of application with all tested STL and C++ classes datatypes.

#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;
}

Downloads

Download demo project - 4 Kb
Add-on binary files - 514 Kb

Project is a comercial product that is why no source available. Now add-on is in beta testing phase, but if you take action into bug tracking process then you will be added to users database and have add-on without any payment. Help author to make product more stable and author will help you in your developers work by it's add-on...

Release Candidate: download file - 565 Kb



Comments

  • ToDoCached for STLPort

    Posted by Legacy on 12/17/2003 12:00am

    Originally posted by: Emmanuel Vaie

    Hi there !

    This is a very nice piece of code you did 2 years ago with this add-on. I may arrive too late, but I needed for professional development purposes
    to extend your add-on to STLPort classes. I didn't change very much of you code, and for the moment strings and vectors are ok, but for the maps I'm a little bit
    stopped. Did you try unsuccesfully to extend your add-on to STLPort classes by the past ?

    Cheers,

    Emmanuel

    Reply
  • where is the source code??

    Posted by Legacy on 04/16/2002 12:00am

    Originally posted by: desperate developer

    where is the source code??

    I would like to build such an add-on for my data type

    keller@post.tau.ac.il

    • i want to have a Fern code

      Posted by geenna on 11/07/2004 07:54am

      can i get a Fern code ?

      Reply
    Reply
  • Enhancement request

    Posted by Legacy on 01/16/2002 12:00am

    Originally posted by: Bob Clarke

    Please clear the Macro tab window contents before showing results. This keeps the user from having to right-click in the macro window and selecting Clear before clicking on the Show Results button.

    Reply
  • Multi-dimensions?

    Posted by Legacy on 01/14/2002 12:00am

    Originally posted by: Richard Ho

    Great product! I've found it quite useful.
    Any plans for a multi-dimensional version? Eg, being able to view the contents of the 2nd layer vectors would be good:

    std::list< std::vector< int > > exampleList;

    Something like the existing Quickwatch in Visual Studio would be nice.

    Regs,

    -Rich.

    Reply
  • Sounds interesting but ...

    Posted by Legacy on 01/10/2002 12:00am

    Originally posted by: jase jennings

    Hi,

    This Add-in sounds interesting but i cannot get it to work!
    It's available as an add in, and i have the toolbar visible in Visual studio. I have configured it to recognise // TODO : , and i have an open workspace with a number of projects containing this keyword. When i click on parse, and then show report, nothing at all happens.

    How do you use this ? Or maybe it's not working ?

    Thanks

    Jase

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Download the Information Governance Survey Benchmark Report to gain insights that can help you further establish business value in your Records and Information Management (RIM) program and across your entire organization. Discover how your peers in the industry are dealing with this evolving information lifecycle management environment and uncover key insights such as: 87% of organizations surveyed have a RIM program in place 8% measure compliance 64% cannot get employees to "let go" of information for …

  • Live Event Date: May 6, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT While you likely have very good reasons for remaining on WinXP after end of support -- an estimated 20-30% of worldwide devices still are -- the bottom line is your security risk is now significant. In the absence of security patches, attackers will certainly turn their attention to this new opportunity. Join Lumension Vice President Paul Zimski in this one-hour webcast to discuss risk and, more importantly, 5 pragmatic risk mitigation techniques …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds