|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2009-2016, Albertas Vyšniauskas |
| 2 | + * Copyright (c) 2009-2022, Albertas Vyšniauskas |
3 | 3 | * All rights reserved.
|
4 | 4 | *
|
5 | 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
20 | 20 | #define GPICK_PARSER_TEXT_FILE_H_
|
21 | 21 | #include <cstddef>
|
22 | 22 | struct Color;
|
23 |
| -namespace text_file_parser |
24 |
| -{ |
25 |
| - struct Configuration |
26 |
| - { |
27 |
| - Configuration(); |
28 |
| - bool single_line_c_comments; |
29 |
| - bool single_line_hash_comments; |
30 |
| - bool multi_line_c_comments; |
31 |
| - bool short_hex; |
32 |
| - bool full_hex; |
33 |
| - bool css_rgb; |
34 |
| - bool css_rgba; |
35 |
| - bool float_values; |
36 |
| - bool int_values; |
37 |
| - }; |
38 |
| - struct TextFile |
39 |
| - { |
40 |
| - bool parse(const Configuration &configuration); |
41 |
| - virtual ~TextFile(); |
42 |
| - virtual void outOfMemory() = 0; |
43 |
| - virtual void syntaxError(size_t start_line, size_t start_column, size_t end_line, size_t end_colunn) = 0; |
44 |
| - virtual size_t read(char *buffer, size_t length) = 0; |
45 |
| - virtual void addColor(const Color &color) = 0; |
46 |
| - }; |
| 23 | +namespace text_file_parser { |
| 24 | +struct Configuration { |
| 25 | + Configuration(bool initialValue = true); |
| 26 | + bool singleLineCComments; |
| 27 | + bool singleLineHashComments; |
| 28 | + bool multiLineCComments; |
| 29 | + bool shortHex; |
| 30 | + bool fullHex; |
| 31 | + bool shortHexWithAlpha; |
| 32 | + bool fullHexWithAlpha; |
| 33 | + bool cssRgb; |
| 34 | + bool cssRgba; |
| 35 | + bool cssHsl; |
| 36 | + bool cssHsla; |
| 37 | + bool floatValues; |
| 38 | + bool intValues; |
| 39 | +}; |
| 40 | +struct TextFile { |
| 41 | + bool parse(const Configuration &configuration); |
| 42 | + virtual ~TextFile(); |
| 43 | + virtual void outOfMemory() = 0; |
| 44 | + virtual void syntaxError(size_t startLine, size_t startColumn, size_t endLine, size_t endColunn) = 0; |
| 45 | + virtual size_t read(char *buffer, size_t length) = 0; |
| 46 | + virtual void addColor(const Color &color) = 0; |
| 47 | +}; |
47 | 48 | }
|
48 | 49 | #endif /* GPICK_PARSER_TEXT_FILE_H_ */
|
0 commit comments