File: textprocessor.h

package info (click to toggle)
aethera 0.9.3-7
  • links: PTS
  • area: main
  • in suites: woody
  • size: 8,588 kB
  • ctags: 7,282
  • sloc: cpp: 64,544; sh: 9,913; perl: 1,756; makefile: 1,680; python: 258
file content (40 lines) | stat: -rw-r--r-- 1,225 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef __TextProcessor__
#define __TextProcessor__

#include <qstring.h>
#include <qstringlist.h>
#include <qvaluelist.h>
#include <metaformatcontrol.h>

class TextProcessor
{
	public:
		// quote text, given text and quote sequence
		static QString quoteText(QString &, const QString &);

		// unquote text, given text and quote sequence list
		static QString unquoteText(QString &, const QStringList &);

		// indent text using given number of spaces
		static QString indentText(QString &, int spaces=1);

		// unindent text using given number of spaces
		static QString unindentText(QString &, int spaces=1);

		// indent text using given number of tabs
		static QString indentTabText(QString &, int tabs=1);

		// unindent text using given number of tabs
		static QString unindentTabText(QString &, int tabs=1);

		// metaformat text for reply detection, given control object
		static QString metaFormat(QString, const MetaFormatControl &);
	private:
		// (internal) maximum sequence of transformations that can be applied on given text
		static QStringList depth(QString, const QStringList &);
	
		// (internal) strips text, given list of transformations
		static QString strip(QString, const QStringList &);
};

#endif