Remove outermost loop parameter.
[official-gcc/graphite-test-results.git] / libpcp / pcp_string_buffer.h
blobbd3180876f808982fdbd65ba65897f70ceda1cfa
1 // Copyright (C) 2009 Free Software Foundation, Inc.
2 // Contributed by Jan Sjodin <jan.sjodin@amd.com>.
4 // This file is part of the Polyhedral Compilation Package Library (libpcp).
6 // Libpcp is free software; you can redistribute it and/or modify it
7 // under the terms of the GNU Lesser General Public License as published by
8 // the Free Software Foundation; either version 2.1 of the License, or
9 // (at your option) any later version.
11 // Libpcp is distributed in the hope that it will be useful, but WITHOUT ANY
12 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
14 // more details.
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with libpcp; see the file COPYING.LIB. If not, write to the
18 // Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 // MA 02110-1301, USA.
21 // As a special exception, if you link this library with other files, some
22 // of which are compiled with GCC, to produce an executable, this library
23 // does not by itself cause the resulting executable to be covered by the
24 // GNU General Public License. This exception does not however invalidate
25 // any other reasons why the executable file might be covered by the GNU
26 // General Public License.
28 // PCP String Buffer
29 #ifndef _PCP_STRING_BUFFER_
30 #define _PCP_STRING_BUFFER_
32 #include <stdio.h>
33 #include <string.h>
35 class PcpStringBuffer
37 protected:
38 int size;
39 int capacity;
40 char* buffer;
42 virtual void setSize(int size);
43 virtual void setCapacity(int capacity);
44 virtual int getCapacity();
45 virtual void setBuffer(char* rawBuffer);
46 virtual char* getBuffer();
47 virtual void ensureCapacity(int capacity);
49 public:
50 // Get length of string in BUFFER.
51 virtual int getLength();
53 // Get size of BUFFER.(one more than length because of '\0')
54 virtual int getSize();
56 // Convert BUFFER to string.
57 virtual const char* toString();
59 // Create a new string buffer.
60 PcpStringBuffer();
62 // Append STRING to BUFFER.
63 virtual void append(const char* string);
65 // Append newline to BUFFER.
66 virtual void newline();
68 // Append CHARACTER to BUFFER.
69 virtual void appendChar(char character);
71 // Append integer VALUE to BUFFER.
72 virtual void appendInt(int value);
74 // Append integer PTR to BUFFER.
75 virtual void appendPointer(void* ptr);
77 // Append BUFFER2 to BUFFER.
78 virtual void appendBuffer(PcpStringBuffer* buffer2);
82 #endif // _PCP_STRING_BUFFER_