Last change
on this file since 1331 was
1331,
checked in by Maciej Komosinski, 6 days ago
|
- more input types in writeCompleteFile(), with "span" being the common interface
- writeCompleteFile() no longer produces a false warning when writing an empty file
|
File size:
1.0 KB
|
Rev | Line | |
---|
[840] | 1 | // This file is a part of Framsticks SDK. http://www.framsticks.com/
|
---|
[1331] | 2 | // Copyright (C) 1999-2024 Maciej Komosinski and Szymon Ulatowski.
|
---|
[840] | 3 | // See LICENSE.txt for details.
|
---|
| 4 |
|
---|
| 5 | #ifndef _UTIL_FILES_H_
|
---|
| 6 | #define _UTIL_FILES_H_
|
---|
| 7 |
|
---|
| 8 | #include "nonstd_stl.h"
|
---|
[1153] | 9 | #ifdef USE_VIRTFILE
|
---|
[1124] | 10 | #include "virtfile/virtfile.h"
|
---|
[1153] | 11 | #else
|
---|
| 12 | #include <stdio.h>
|
---|
| 13 | #endif
|
---|
[1331] | 14 | #include <common/nonstd_span.h>
|
---|
[840] | 15 |
|
---|
| 16 | bool readCompleteFile(const char* filename, vector<char>& data, bool warn_on_missing_file = true);
|
---|
| 17 | bool readCompleteFile(const char* filename, string& out, bool warn_on_missing_file = true);
|
---|
| 18 | bool writeCompleteFile(const char* filename, const std::string& text, bool warn_on_fail = true);
|
---|
[1331] | 19 | bool writeCompleteFile(const char* filename, const span<char>& data, bool warn_on_fail = true);
|
---|
| 20 | bool writeCompleteFile(const char* filename, const span<uint8_t>& data, bool warn_on_fail = true);
|
---|
| 21 | bool writeCompleteFile(const char* filename, const vector<char>& data, bool warn_on_fail);
|
---|
[1153] | 22 | #ifdef USE_VIRTFILE
|
---|
[1124] | 23 | string readUntilEOL(VirtFILE *f);
|
---|
[1153] | 24 | #else
|
---|
| 25 | string readUntilEOL(FILE *f);
|
---|
| 26 | #endif
|
---|
[840] | 27 |
|
---|
| 28 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.