|
a/src/common/textsplit.h |
|
b/src/common/textsplit.h |
|
... |
|
... |
14 |
* Free Software Foundation, Inc.,
|
14 |
* Free Software Foundation, Inc.,
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16 |
*/
|
16 |
*/
|
17 |
#ifndef _TEXTSPLIT_H_INCLUDED_
|
17 |
#ifndef _TEXTSPLIT_H_INCLUDED_
|
18 |
#define _TEXTSPLIT_H_INCLUDED_
|
18 |
#define _TEXTSPLIT_H_INCLUDED_
|
19 |
/* @(#$Id: textsplit.h,v 1.15 2006-12-08 07:11:17 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: textsplit.h,v 1.16 2007-01-18 12:09:58 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
|
20 |
|
21 |
#include <string>
|
21 |
#include <string>
|
22 |
#ifndef NO_NAMESPACES
|
22 |
#ifndef NO_NAMESPACES
|
23 |
using std::string;
|
23 |
using std::string;
|
24 |
#endif
|
24 |
#endif
|
|
... |
|
... |
42 |
* This uses a callback function. It could be done with an iterator instead,
|
42 |
* This uses a callback function. It could be done with an iterator instead,
|
43 |
* but 'ts much simpler this way...
|
43 |
* but 'ts much simpler this way...
|
44 |
*/
|
44 |
*/
|
45 |
class TextSplit {
|
45 |
class TextSplit {
|
46 |
public:
|
46 |
public:
|
47 |
enum Flags {TXTS_NONE = 0, TXTS_ONLYSPANS = 1, TXTS_NOSPANS = 2};
|
47 |
enum Flags {TXTS_NONE = 0, TXTS_ONLYSPANS = 1, TXTS_NOSPANS = 2,
|
|
|
48 |
TXTS_KEEPWILD = 4};
|
48 |
/**
|
49 |
/**
|
49 |
* Constructor: just store callback object
|
50 |
* Constructor: just store callback object
|
50 |
*/
|
51 |
*/
|
51 |
TextSplit(TextSplitCB *t, Flags flags = TXTS_NONE)
|
52 |
TextSplit(TextSplitCB *t, Flags flags = TXTS_NONE)
|
52 |
: m_flags(flags), cb(t), maxWordLength(40), prevpos(-1) {}
|
53 |
: m_flags(flags), cb(t), maxWordLength(40), prevpos(-1) {}
|