nix startup on theme fail, fixes for font init and titler color model
[goodguy/history.git] / cinelerra-5.0 / guicast / stringfile.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef STRINGFILE_H
23 #define STRINGFILE_H
24
25
26 // Line based reading and writing from text files or arrays.
27 // Use for extracting databases.
28 #include "units.h"
29
30 class StringFile
31 {
32 public:
33         StringFile(size_t length = 0);
34         StringFile(const char *filename);
35         virtual ~StringFile();
36
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
43
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
55
56         size_t get_length();
57         size_t get_pointer();
58         int write_to_file(const char *filename);
59         int read_from_string(const char *string);
60
61         char *string;
62         size_t pointer, length, available;
63         char string1[1024];      // general purpose strings
64 };
65
66 #endif