00001 /*************************************************************************** 00002 ctagsreader.h - description 00003 ------------------- 00004 begin : Tue Oct 21 2008 00005 copyright : (C) 2008 by Andre Simon 00006 email : andre.simon1@gmx.de 00007 ***************************************************************************/ 00008 00009 00010 /* 00011 This file is part of Highlight. 00012 00013 Highlight is free software: you can redistribute it and/or modify 00014 it under the terms of the GNU General Public License as published by 00015 the Free Software Foundation, either version 3 of the License, or 00016 (at your option) any later version. 00017 00018 Highlight is distributed in the hope that it will be useful, 00019 but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 GNU General Public License for more details. 00022 00023 You should have received a copy of the GNU General Public License 00024 along with Highlight. If not, see <http://www.gnu.org/licenses/>. 00025 */ 00026 00027 00028 #ifndef CTAGSREADER_H 00029 #define CTAGSREADER_H 00030 00031 #include <string> 00032 #include <sstream> 00033 #include <map> 00034 #include <iostream> 00035 #include <fstream> 00036 00037 using namespace std; 00038 00040 class TagInfo 00041 { 00042 public: 00043 TagInfo() {}; 00044 string getKind() const; 00045 string file, kind, name_space; 00046 00047 }; 00048 00050 typedef map<string, TagInfo> TagsMap; 00051 00052 class CTagsReader 00053 { 00054 public: 00055 00056 CTagsReader() {}; 00057 ~CTagsReader() {}; 00058 00063 bool load ( const string & ctags_path ); 00064 00069 bool tagExists ( const string& tagname ) 00070 { 00071 return tags.count ( tagname ) >0; 00072 } 00073 00078 TagInfo getTagInfo ( const string &tagname ) 00079 { 00080 return tags[tagname]; 00081 } 00082 00083 private: 00084 00085 TagsMap tags; 00086 }; 00087 00088 /* 00089 c class name 00090 d define (from #define XXX) 00091 e enumerator 00092 f function or method name 00093 F file name 00094 g enumeration name 00095 m member (of structure or class data) 00096 p function prototype 00097 s structure name 00098 t typedef 00099 u union name 00100 v variable 00101 00102 */ 00103 00104 #endif