Source-highlight Library
|
00001 // 00002 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004-2008 00003 // 00004 // Copyright: See COPYING file that comes with this distribution 00005 // 00006 00007 #ifndef CTAGSFORMATTER_H_ 00008 #define CTAGSFORMATTER_H_ 00009 00010 #include <string> 00011 #include <list> 00012 00013 #include "textstyles.h" 00014 00015 namespace srchilite { 00016 00017 class PreFormatter; 00018 class CTagsCollector; 00019 struct FormatterParams; 00020 00022 typedef std::list<std::string> postResults; 00023 00027 struct CTagsFormatterResults { 00029 std::string inlineResult; 00030 00032 postResults postLineResult; 00033 00035 postResults postDocResult; 00036 00040 void clear() { 00041 inlineResult.clear(); 00042 postLineResult.clear(); 00043 postDocResult.clear(); 00044 } 00045 }; 00046 00050 class CTagsFormatter { 00052 std::string inputFile; 00053 00055 std::string inputFileName; 00056 00058 std::string outputFile; 00059 00061 std::string outputFileExtension; 00062 00064 PreFormatter *preFormatter; 00065 00067 TextStyles::RefTextStyle refstyle; 00068 00070 CTagsCollector *ctagsCollector; 00071 00072 public: 00073 CTagsFormatter(PreFormatter *pre, const TextStyles::RefTextStyle &r, 00074 CTagsCollector *ctagsC); 00075 ~CTagsFormatter(); 00076 00077 void setPreFormatter(PreFormatter *pre) { 00078 preFormatter = pre; 00079 } 00080 00086 void setFileInfo(const std::string &input, const std::string &output); 00087 00096 bool formatCTags(const std::string &word, CTagsFormatterResults &result, 00097 const FormatterParams *params); 00098 }; 00099 00100 } 00101 00102 #endif /*CTAGSFORMATTER_H_*/