CodeView  Version0.4
 All Classes Functions Variables
format_c.h
1 /* libcodeview.so - A programmers editor widget for Atheos
2  Copyright (c) 2001 Andreas Engh-Halstvedt
3  Copyright (c) 2003 Henrik Isaksson
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public
16  License along with this library; if not, write to the Free
17  Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18  MA 02111-1307, USA
19 */
20 
21 #ifndef F_CODEVIEW_FORMAT_C_H
22 #define F_CODEVIEW_FORMAT_C_H
23 
24 #include "format.h"
25 
26 namespace cv
27 {
28 
32 class Format_C : public Format {
33 private:
34  enum{
35  F_DEFAULT = 0,
36  F_COMMENT,
37  F_STRING,
38  F_CHAR,
39  F_KEYWORD,
40 
41  FORMAT_COUNT//this is not a format!
42  };
43 
44  CodeViewStyle styles[FORMAT_COUNT];
45 
46  void FindWords(const os::String&, os::String&);
47 
48 public:
49  Format_C();
50 
51  uint GetStyleCount();
52  const os::String& GetStyleName( char );
53  void SetStyle( char, const CodeViewStyle& );
54  const CodeViewStyle& GetStyle( char );
55 
56  CodeViewContext Parse( const os::String &cLine, os::String &cFormat, CodeViewContext cookie);
57 
58  os::String GetIndentString( const os::String &cText, bool bUseTabs, uint nTabSize );
59 
60  uint GetPreviousWordLimit( const os::String&, uint nChr );
61  uint GetNextWordLimit( const os::String&, uint nChr );
62  int GetFoldLevel( const os::String &cLine, int nOldFoldLevel );
63 };
64 
65 } /* namespace cv */
66 
67 #endif /* F_CODEVIEW_FORMAT_C_H */