xref: /aoo41x/main/xml2cmp/source/xcd/filebuff.hxx (revision dd7bc091)
1*dd7bc091SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*dd7bc091SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*dd7bc091SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*dd7bc091SAndrew Rist  * distributed with this work for additional information
6*dd7bc091SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*dd7bc091SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*dd7bc091SAndrew Rist  * "License"); you may not use this file except in compliance
9*dd7bc091SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*dd7bc091SAndrew Rist  *
11*dd7bc091SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*dd7bc091SAndrew Rist  *
13*dd7bc091SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*dd7bc091SAndrew Rist  * software distributed under the License is distributed on an
15*dd7bc091SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*dd7bc091SAndrew Rist  * KIND, either express or implied.  See the License for the
17*dd7bc091SAndrew Rist  * specific language governing permissions and limitations
18*dd7bc091SAndrew Rist  * under the License.
19*dd7bc091SAndrew Rist  *
20*dd7bc091SAndrew Rist  *************************************************************/
21*dd7bc091SAndrew Rist 
22*dd7bc091SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef X2C_FILEBUFF_HXX
25cdf0e10cSrcweir #define X2C_FILEBUFF_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir class Buffer
29cdf0e10cSrcweir {
30cdf0e10cSrcweir   public:
Buffer()31cdf0e10cSrcweir 						Buffer() 			   	: s(0) {}
~Buffer()32cdf0e10cSrcweir 						~Buffer()               { if (s) delete [] s; }
33cdf0e10cSrcweir 						operator const char *() const
34cdf0e10cSrcweir 												{ return s; }
Data()35cdf0e10cSrcweir 	char *				Data() 					{ return s; }
SetSize(unsigned long i_size)36cdf0e10cSrcweir 	void               	SetSize(
37cdf0e10cSrcweir 						   unsigned	long 			    i_size )
38cdf0e10cSrcweir 							                    { if (s) delete [] s; s = new char [i_size]; }
39cdf0e10cSrcweir   private:
40cdf0e10cSrcweir 	char * s;
41cdf0e10cSrcweir };
42cdf0e10cSrcweir 
43cdf0e10cSrcweir 
44cdf0e10cSrcweir bool				LoadXmlFile(
45cdf0e10cSrcweir 						Buffer & 			o_rBuffer,
46cdf0e10cSrcweir 						const char *		i_sXmlFilePath );
47cdf0e10cSrcweir 
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 
50cdf0e10cSrcweir #endif
51