Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Include File Hierarchy Viewer

, 29 Jul 2003
A tool to view the include file hierarchy of your source code.
//====================================================================
// Although great care has gone into developing this software,
// it is provided without any guarantee of reliability, accuracy
// of information, or correctness of operation.  I am not responsible
// for any damages that may occur as a result of using this software.
// Use this software entirely at your own risk.
// Copyright 2003, Chris Richardson
//
// Description: Source level token.
//
//====================================================================

#include "stdafx.h"
#include "Token.h"

//////////////////////////////////////////////////////////////////////
// CToken Implementation.
//////////////////////////////////////////////////////////////////////

CToken::CToken() :
   c_eType( TOKEN_NONE ),
   c_ulPos( 0 ),
   c_ulFlags( 0 )
{
   memset( c_szID, 0, sizeof( c_szID ) );
}
//
// ------------------------------------------------------------------
//
CToken::~CToken()
{
}
//
// ------------------------------------------------------------------
//
void CToken::Reset()
{
   c_szID[0] = _T('\0');
   c_eType = TOKEN_NONE;
}
//
// ------------------------------------------------------------------
//
void CToken::Set( const TCHAR * p_pszID, unsigned long p_ulPos, ParseTokens p_eType )
{
   int a_iLen = _tcslen( p_pszID );
   if( a_iLen+1 > MAX_TOKEN )
   {
      // We must truncate it.
      _tcsncpy( c_szID, p_pszID, MAX_TOKEN-1 );
      c_szID[MAX_TOKEN-1] = _T('\0');
   }
   else
      _tcscpy( c_szID, p_pszID );
   
   c_ulPos = p_ulPos;
   c_eType = p_eType;
}
//
// ------------------------------------------------------------------
//
void CToken::Set( const TCHAR p_cC, unsigned long p_ulPos, ParseTokens p_eType )
{
   c_szID[0] = p_cC;
   c_szID[1] = _T('\0');
   c_eType   = p_eType;
   c_ulPos   = p_ulPos;
}
//
// ------------------------------------------------------------------
//

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)

Share

About the Author

Chris Richardson
Software Developer (Senior)
United States United States
I like to program, I like to sail.

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 30 Jul 2003
Article Copyright 2003 by Chris Richardson
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid