1 /* Copyright (C) 2021 Free Software Foundation, Inc.
4 This file is part of GNU Binutils.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
22 * java/lang/StringBuilder
24 * Based on JavaTM 2 Platform Standard Ed. 5.0
27 #ifndef _StringBuilder_h
28 #define _StringBuilder_h
34 StringBuilder (int capacity
);
35 virtual ~StringBuilder ();
49 bool endsWith (const char str
[]);
50 void ensureCapacity (int minimumCapacity
);
51 void expandCapacity (int minimumCapacity
);
54 void setLength (int newLength
);
55 char charAt (int index
);
56 void getChars (int srcBegin
, int srcEnd
, char dst
[], int dstBegin
);
57 void setCharAt (int index
, char ch
);
58 StringBuilder
*append (StringBuilder
*sb
);
59 StringBuilder
*append (const char str
[]);
60 StringBuilder
*append (const char str
[], int offset
, int len
);
61 StringBuilder
*append (bool b
);
62 StringBuilder
*append (char c
);
63 StringBuilder
*append (int i
);
64 StringBuilder
*append (unsigned int i
);
65 StringBuilder
*append (long lng
);
66 StringBuilder
*append (unsigned long i
);
67 StringBuilder
*append (long long lng
);
68 StringBuilder
*append (unsigned long long lng
);
69 StringBuilder
*append (float f
);
70 StringBuilder
*append (double d
);
71 StringBuilder
*_delete (int start
, int end
);
72 StringBuilder
*deleteCharAt (int index
);
73 StringBuilder
*insert (int index
, const char str
[], int offset
, int len
);
74 StringBuilder
*insert (int offset
, const char str
[]);
75 StringBuilder
*insert (int offset
, bool b
);
76 StringBuilder
*insert (int offset
, char c
);
77 StringBuilder
*insert (int offset
, int i
);
78 StringBuilder
*insert (int offset
, long l
);
79 StringBuilder
*insert (int offset
, float f
);
80 StringBuilder
*insert (int offset
, double d
);
81 StringBuilder
*reverse ();
83 void toFile (FILE *fp
);
84 void toFileLn (FILE *fp
);
87 StringBuilder
*appendf (const char *fmt
, ...) __attribute__ ((format (printf
, 2, 3)));
88 StringBuilder
*sprintf (const char *fmt
, ...) __attribute__ ((format (printf
, 2, 3)));
90 int indexOf (const char str
[]);
91 int indexOf (const char str
[], int fromIndex
);
92 int lastIndexOf (const char str
[]);
93 int lastIndexOf (const char str
[], int fromIndex
);
101 #endif /* _StringBuilder_h */