4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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 2 of the License, or
9 * (at your option) any later version.
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, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 // Line based reading and writing from text files or arrays.
27 // Use for extracting databases.
33 StringFile(size_t length = 0);
34 StringFile(const char *filename);
35 virtual ~StringFile();
37 int readline(); // read next line from string
38 int readline(char *arg2); // read next line from string
39 int readline(long *arg2); // read next line from string
40 int readline(int *arg2); // read next line from string
41 int readline(float *arg2); // read next line from string
42 int readline(Freq *arg2); // read next line from string
44 int readline(char *arg1, char *arg2); // read next line from string
45 int readline(char *arg1, long *arg2); // read next line from string
46 int readline(char *arg1, int *arg2); // read next line from string
47 int readline(char *arg1, float *arg2); // read next line from string
48 int writeline(char *arg1, int indent); // write next line to string
49 int writeline(char *arg1, char *arg2, int indent); // write next line to string
50 int writeline(char *arg1, long arg2, int indent); // write next line to string
51 int writeline(char *arg1, int arg2, int indent); // write next line to string
52 int writeline(char *arg1, float arg2, int indent); // write next line to string
53 int writeline(char *arg1, Freq arg2, int indent); // write next line to string
54 int backupline(); // move back one line
58 int write_to_file(const char *filename);
59 int read_from_string(const char *string);
62 size_t pointer, length, available;
63 char string1[1024]; // general purpose strings