xref: /trunk/main/xml2cmp/source/inc/textbuff.h (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef CTLS_TEXTBUFF_H
29 #define CTLS_TEXTBUFF_H
30 
31 #include "textfile.h"
32 
33 
34 typedef struct TextBuffer
35 {
36 	char *				dpText;
37 	intt				nSize;
38 
39 	intt				nPosition;
40 
41 } TextBuffer;
42 
43 #define TextBuffer_THIS		TextBuffer * pThis
44 
45 
46 #define ENDS	'\0'
47 #define ENDL	'\n'
48 
49 typedef enum E_TB_Relation
50 {
51 	tb_begin,
52 	tb_cur,
53 	tb_end
54 } E_TB_Relation;
55 
56 
57 void			   	TextBuffer_CTOR( TextBuffer_THIS,
58 						intt				i_nSize );
59 void				TextBuffer_DTOR( TextBuffer_THIS );
60 void				TB_Resize( TextBuffer_THIS,
61                     	intt				i_nNewSize );
62 
63 Bool				TB_oin( TextBuffer_THIS,				/** operator>>(char *) */
64 						char * 				i_pText );
65 Bool				TB_oinChar( TextBuffer_THIS,			/** operator>>(char) */
66 						char  				i_cChar );
67 Bool				TB_oinFile( TextBuffer_THIS,			/** operator>>(TextFile*)  */
68 						TextFile *			i_pFile );
69 void				TB_opp( TextBuffer_THIS );				/** operator++ */
70 
71 intt				TB_Goto( TextBuffer_THIS,
72 						intt				i_nPosition,
73 						E_TB_Relation		i_nRelation );		/**	tb_begin, tb_cur, tb_end */
74 
75 
76 char *				TB_Text( TextBuffer_THIS );
77 char				TB_CurChar( TextBuffer_THIS );
78 char *				TB_CurCharPtr( TextBuffer_THIS );
79 intt				TB_Size( TextBuffer_THIS );
80 intt				TB_Position( TextBuffer_THIS );
81 Bool				TB_EndOfBuffer( TextBuffer_THIS );
82 
83 
84 #endif
85 
86