etagsdb.h
Go to the documentation of this file.00001 #ifndef ETAGS_H_INCLUDED
00002 #define ETAGS_H_INCLUDED
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00036
00037 #include <string>
00038 #include <portable_io.h>
00039 #include <list>
00040
00041 namespace cxxtls
00042 {
00043
00044 class EtagsDB
00048 {
00049 FILE* file_;
00050 std::string filename_;
00051 std::string symbol_;
00052
00053 public:
00054
00055 EtagsDB(std::string etags_database_filename);
00056 EtagsDB();
00057
00058 ~EtagsDB();
00059
00060 bool ok() const { return file_ != 0; }
00061
00062 bool set_tags_file(std::string tagsfile);
00063
00064
00065
00066
00067
00068
00069 bool find_first(std::string const &symbol,
00070 std::string *file_name,
00071 int *line_number,
00072 std::string *line_text,
00073 bool case_sensitive_search=false
00074 );
00088
00089
00090 bool find_next( std::string *file_name,
00091 int *line_number,
00092 std::string *line_text
00093 );
00099
00100
00101 int matching_files(std::string relative_path, std::list<std::string> *output) const;
00117
00118
00119 private:
00120
00121 bool case_sensitive_;
00122
00123 EtagsDB(EtagsDB const &);
00124
00125 EtagsDB& operator= (EtagsDB const&);
00126
00127 char most_recent_file_[2048];
00128
00129
00130 int searchFor( std::string const &symbol,
00131 std::string *foundFile,
00132 int *foundLine,
00133 std::string *sourceText
00134 );
00156
00157 };
00158
00159 }
00160
00161 #endif