CodeView  Version0.4
 All Classes Functions Variables
format_ruby.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_RUBY_H
22 #define F_CODEVIEW_FORMAT_RUBY_H
23 
24 #include "format.h"
25 
26 namespace cv
27 {
28 class Format_Ruby : public Format {
29 private:
30  enum{
31  F_DEFAULT = 0,
32  F_COMMENT,
33  F_STRING,
34  F_CHAR,
35  F_KEYWORD,
36 
37  FORMAT_COUNT //this is not a format!
38  };
39 
40  CodeViewStyle styles[FORMAT_COUNT];
41 
42  void FindWords(const os::String&, os::String&);
43 
44 public:
45  Format_Ruby();
46 
47  uint GetStyleCount();
48  const os::String& GetStyleName( char );
49  void SetStyle( char, const CodeViewStyle& );
50  const CodeViewStyle& GetStyle( char );
51 
52  CodeViewContext Parse( const os::String &cLine, os::String &cFormat, CodeViewContext cookie);
53 
54  os::String GetIndentString( const os::String &cText, bool bUseTabs, uint nTabSize );
55 
56  uint GetPreviousWordLimit( const os::String&, uint nChr );
57  uint GetNextWordLimit( const os::String&, uint nChr );
58 };
59 
60 } /* namespace cv */
61 
62 #endif /* F_CODEVIEW_FORMAT_RUBY_H */
63