Click here to Skip to main content
15,896,557 members
Articles / Programming Languages / C++

ToDoList Add-on

Rate me:
Please Sign up or sign in to vote.
4.69/5 (6 votes)
20 Apr 2002CPOL3 min read 242.4K   2.9K   57  
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
/**************************************************************************\
  created:    2001/03/04
  created:    4:3:2001   12:17
  filename:   Parser\prsExceptions.h
  file path:  .\Parser
  file base:  prsExceptions
  file ext:   h
  author:     Alex Kucherenko
  
  purpose:  In file declared all exceptions which can be throwed by Parser
\**************************************************************************/

#ifndef _PARSER_TODO_EXCEPTIONS_H_
#define _PARSER_TODO_EXCEPTIONS_H_

#pragma once

// Disable some warnings while using STL
#pragma warning (disable : 4800 4290 4786 4503 )

// Enable warning level 3 for STL
#pragma warning ( push, 3 )

#include <string>
#include <vector>
#include <map>

// Disable warning level 3 and return default level
#pragma warning( pop )

// Set std::string to our namespace like simple string
typedef std::string string;

// -- here defined main types because this header include all
// parser files --
//typedef std::map< long, string >  TLineMapper;
//typedef TLineMapper::iterator     TLineMapperIter;
//typedef std::vector< string >     TStrArray;
//typedef TStrArray::iterator       TStrArrayIter;

#ifndef MAX_STRING_LENGTH
  #define MAX_STRING_LENGTH 8192
#endif

class CToDoException
{
  public:
    // Constructor which set error message
    CToDoException( const string &ErrorMessage ) : 
      m_strError( ErrorMessage ), m_strMore( " " ) { };
    
    // Constructor which set error ad moreinfo messages
    CToDoException( const string &ErrorMessage, const string &MoreInfo ) : 
      m_strError( ErrorMessage ), 
      m_strMore( MoreInfo ) { };

    // destructor
    virtual ~CToDoException( ) { };

    // Get More Info message
    string GetMoreInfo( void ) const 
    {
      return m_strMore;
    };

    // Get ErrorInfo message
    string GetErrorMessage( void ) const 
    {
      return m_strError;
    };

  protected:
    // Used by classes which inherite this class for modifying MoreInfo var
    void SetMoreInfo( const string &MoreInfo )
    {
      m_strMore = MoreInfo;
    };

    // Used by classes which inherite this class for modifying ErrorInfo var
    void SetErrorMessage( const string &Error )
    {
      m_strError = Error;
    };
    
  private:
    // private memberes of Exception class
    string  m_strError;
    string  m_strMore;

};

//////////////////////////////////////////////////////////////////////////
// Exception will be created when class have no elements for iterator

class CToDoNoElements : public CToDoException
{
  public:
    CToDoNoElements() : CToDoException( "ERROR: No elements in class" ) { };
    
    CToDoNoElements( const string &MoreInfo ) : 
      CToDoException ( "ERROR: No elements in class", MoreInfo ) { };
};

//////////////////////////////////////////////////////////////////////////
// Exception will be created when iterator rich first element

class CToDoFirstRiched : public CToDoException
{
  public:
    CToDoFirstRiched() : CToDoException( "WARNING: First element riched by iterator" ) { };

    CToDoFirstRiched( const string &MoreInfo ) : 
      CToDoException( "WARNING: First element riched by iterator", MoreInfo ) { };
};

//////////////////////////////////////////////////////////////////////////
// Exception will be created whe iterator rich last element

class CToDoLastRiched : public CToDoException
{
  public:
    CToDoLastRiched() : CToDoException( "WARNING: Last Element riched by iterator" ) { };

    CToDoLastRiched( const string &MoreInfo ) : 
      CToDoException( "WARNING: Last Element riched by iterator", MoreInfo ) { };
};

//////////////////////////////////////////////////////////////////////////
// Excepttion will be created if error acquired while work with file

class CToDoFileWork : public CToDoException
{
  public:
    CToDoFileWork() : CToDoException( "ERROR: While work with file acquired error" ) { };

    CToDoFileWork( const string &MoreInfo ) : 
      CToDoException( "ERROR: While work with file acquired error", MoreInfo ) { };
};

#endif /* _PARSER_TODO_EXCEPTIONS_H_ */

//:> End of file

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

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