etagsdb.h

Go to the documentation of this file.
00001 #ifndef ETAGS_H_INCLUDED
00002 #define ETAGS_H_INCLUDED
00003 //
00004 // Copyright 2002, Lowell Boggs Jr.
00005 //
00006 // This file or directory, containing source code for a computer program,
00007 // is Copyrighted by Lowell Boggs, Jr.  987 Regency Drive, Lewisville
00008 // TX (USA), 75067.  You may use, copy, modify, and distribute this
00009 // source file without charge or obligation so long as you agree to
00010 // the following:
00011 //
00012 //  1.  You must indemnify Lowell Boggs against any and all financial
00013 //      obligations caused by its use, misuse, function, or malfunction.
00014 //      Further, you acknowledge that there is no warranty of any kind,
00015 //      whatsoever.
00016 //
00017 //  2.  You agree not to attempt to patent any portion of this original
00018 //      work -- though you may attempt to patent your own extensions to
00019 //      it if you so choose.
00020 //
00021 //  3.  You keep this copyright notice with the file and all copies
00022 //      of the file and do not change it anyway except language translation.
00023 //
00024 // You are responsible for enforcing your own compliance with these
00025 // conditions and may not use this source file if you cannot agree to the
00026 // above terms and conditions.
00027 //
00028 // Warning:  not all files in this directory structure are covered by the
00029 // same copyright.  Some of them are part of the GNU source distribution
00030 // and you must obey the GPL copyright for those files.
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,    // text of line of definition
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 } // namespace cxxtls
00160 
00161 #endif
Generated on Wed Feb 29 22:50:03 2012 for CXXUtilities by  doxygen 1.6.3