Click here to Skip to main content
15,860,972 members
Articles / Programming Languages / C++
Article

ToDoList Add-on

Rate me:
Please Sign up or sign in to vote.
4.69/5 (6 votes)
20 Apr 2002CPOL3 min read 240.7K   2.9K   57   60
A Visual Studio add-in to help navigate to TODO:, TASK: etc comments, as well as showing STL containers in debug mode such as std::string, std::list etc

Image 1

Add-on find dialog:

Image 2

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<br/> // 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:

Image 3
Image 4 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
Image 5 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.

Image 6 Options Dialog

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

Image 7 Tabify all files

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

Image 8 Untabify all files

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

Image 9 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 tested with 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;
}

History

Date Posted: 17/Aug/2001
First article was posted to CodeProject
From that moment many things were changed and new functionality added.

Updated: 7/Sep/2001
Tons of changes.

Updated: 20/Jan/2002
More changes.

Updated: 21/Apr/2002
Updated download package

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO ArtfulBits Inc.
Ukraine Ukraine
Name:Kucherenko Oleksandr

Born:September 20, 1979

Platforms: Win32, Linux; - well known and MS-DOS; Win16; OS/2 - old time not touched;

Hardware: IBM PC

Programming Languages: Assembler (for Intel 80386); Borland C/C++; Borland Pascal; Object Pascal; Borland C++Builder; Delphi; Perl; Java; Visual C++; Visual J++; UML; XML/XSL; C#; VB.NET; T-SQL; PL/SQL; and etc.

Development Environments: MS Visual Studio 2001-2008; MS Visual C++; Borland Delphi; Borland C++Builder; C/C++ any; Rational Rose; GDPro; Together and etc.

Libraries: STL, ATL, WTL, MFC, NuMega Driver Works, VCL; .NET 1.0, 1.1, 2.0, 3.5; and etc.

Technologies: Client/Server; COM; DirectX; DirectX Media; BDE; HTML/DHTML; ActiveX; Java Servlets; DCOM; COM+; ADO; CORBA; .NET; Windows Forms; GDI/GDI+; and etc.

Application Skills: Databases - design and maintain, support, programming; GUI Design; System Programming, Security; Business Software Development. Win/Web Services development and etc.

Comments and Discussions

 
QuestionVS2008 Pin
SajeeshCheviry25-Nov-13 18:58
SajeeshCheviry25-Nov-13 18:58 
QuestionCan i use this extension in VS.net? Pin
CobaltD10-May-06 0:30
CobaltD10-May-06 0:30 
AnswerRe: Can i use this extension in VS.net? Pin
Oleksandr Kucherenko10-May-06 0:47
Oleksandr Kucherenko10-May-06 0:47 
Hi,

why not if it works?!

Good Luck
Alex Kucherenko
GeneralRe: Can i use this extension in VS.net? Pin
CobaltD10-May-06 1:10
CobaltD10-May-06 1:10 
AnswerRe: Can i use this extension in VS.net? Pin
Oleksandr Kucherenko10-May-06 1:17
Oleksandr Kucherenko10-May-06 1:17 
GeneralRe: Can i use this extension in VS.net? Pin
CobaltD10-May-06 1:20
CobaltD10-May-06 1:20 
GeneralCannot call commit on this transaction object because the calling application did not initiate the transaction Pin
Aleksan10-Mar-05 20:38
Aleksan10-Mar-05 20:38 
GeneralCompile error with Dinkumware, Ltd. STL Pin
Aleksan8-Mar-05 23:07
Aleksan8-Mar-05 23:07 
GeneralDo not work with Dinkumware, Ltd. STL Pin
Aleksan3-Mar-05 19:42
Aleksan3-Mar-05 19:42 
GeneralRe: Do not work with Dinkumware, Ltd. STL Pin
Oleksandr Kucherenko3-Mar-05 21:17
Oleksandr Kucherenko3-Mar-05 21:17 
GeneralMyClass Pin
Anonymous24-Oct-04 3:22
Anonymous24-Oct-04 3:22 
GeneralRe: MyClass Pin
Portatofe2-Oct-08 6:13
Portatofe2-Oct-08 6:13 
QuestionHow to install Pin
Polushin19-Aug-04 6:30
Polushin19-Aug-04 6:30 
General&quot;.exe&quot; didn't get written. Pin
WREY29-Feb-04 7:34
WREY29-Feb-04 7:34 
GeneralRe: &quot;.exe&quot; didn't get written. Pin
Oleksandr Kucherenko29-Feb-04 21:26
Oleksandr Kucherenko29-Feb-04 21:26 
GeneralRe: &quot;.exe&quot; didn't get written. Pin
WREY1-Mar-04 2:27
WREY1-Mar-04 2:27 
GeneralRe: &quot;.exe&quot; didn't get written. Pin
Oleksandr Kucherenko1-Mar-04 2:59
Oleksandr Kucherenko1-Mar-04 2:59 
Generaldebugger question Pin
Anonymous22-Oct-03 10:29
Anonymous22-Oct-03 10:29 
Generalquestion on _Simplify() function in CStdMap Pin
John_Galt18-Sep-03 6:05
John_Galt18-Sep-03 6:05 
GeneralRe: question on _Simplify() function in CStdMap Pin
Oleksandr Kucherenko18-Sep-03 21:31
Oleksandr Kucherenko18-Sep-03 21:31 
Generalsomething "better" :-O Pin
MachinShin8-Aug-02 18:00
MachinShin8-Aug-02 18:00 
GeneralRe: something "better" :-O Pin
Oleksandr Kucherenko8-Aug-02 21:47
Oleksandr Kucherenko8-Aug-02 21:47 
GeneralWatching 2-level variables Pin
24-May-02 3:21
suss24-May-02 3:21 
GeneralRe: Watching 2-level variables Pin
Oleksandr Kucherenko17-Jun-02 4:41
Oleksandr Kucherenko17-Jun-02 4:41 
GeneralAny Chance of a .NET Version Pin
Stone Free22-Apr-02 0:00
Stone Free22-Apr-02 0:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.