Click here to Skip to main content
15,893,668 members
Articles / Programming Languages / C++

Useful Managers

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
11 Aug 2001 80.6K   1.2K   16  
An add-in for Devstudio that provides tag indexing and search, window, bookmarks, session and other managers
/*****************************************************************************
*   $Id: options.c,v 8.4 1999/05/29 17:56:51 darren Exp $
*
*   Copyright (c) 1996-1999, Darren Hiebert
*
*   This source code is released for free distribution under the terms of the
*   GNU General Public License.
*
*   This module contains functions to process command line options.
// Modified by Mike Melnikov
*****************************************************************************/

#include "stdafx.h"

#include "ctags.h"
#include "options.h"
#include "..\utils.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

/*============================================================================
=   Data declarations
============================================================================*/

//DSPExtensions[] = { "dsp", NULL };
//CppExtensions[] = { "c++", "cpp", "cxx", "h", "hpp", "hxx", NULL };
//HeaderExtensions[] = {"h", "hpp", "hxx", NULL };

optionValues Option;

optionValues::optionValues()
{
  append = false;
  access = false;
}

langType getExtensionLanguage(CString file )
{
  CString extension = findExtension(file);
  //if(extension.IsEmpty())
    //return LANG_IGNORE;		/* ignore files with no extension */
  for (unsigned int i = 0  ;  i < (int)LANG_COUNT  ;  ++i)
  {
    for(int p=0; p<Option.langMap[i].size();p++)
    {
      if(Option.langMap[i][p].CompareNoCase(extension)==0)
      {
        return (langType)i;
      }
    }
  }
  return LANG_IGNORE;
}

//  Determines whether or not "name" should be ignored, per the ignore list.
bool isIgnoreToken(const char* const  name,bool& pIgnoreParens/*,const char **const  replacement*/ )
{
  /////////////////////////////////////////////////////////
  if (strncmp("_CLS_", name, 5) == 0)
    return true;
  /////////////////////////////////////////////////////////

  const size_t nameLen = strlen(name);
  for(int p=0;p<Option.ignore.size();p++ )
  {
    CString& token = Option.ignore[p];
    if(strncmp(token, name, nameLen) == 0)
    {
      const size_t tokenLen = token.GetLength();

      if (nameLen == tokenLen)
      {
        return true;
      }
      else if(tokenLen == nameLen + 1 && token.GetAt(tokenLen - 1) == '+')
      {
        pIgnoreParens = true;
        return true;
      }
      /*
      else if (vStringChar(token, nameLen) == '=')
      {
        *replacement = vStringValue(token) + nameLen + 1;
        break;
      }
      */
    }
  }
  return false;
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Russian Federation Russian Federation
Mike has been programming in C/C++ for 11 years and Visual C++/MFC for 4 years. His background includes pure and applied mathematics, engineering and physics, and he is currently based in Moscow, Russia.

Comments and Discussions