Ignore:
Timestamp:
01/02/25 02:04:21 (3 weeks ago)
Author:
Maciej Komosinski
Message:
  • more input types in writeCompleteFile(), with "span" being the common interface
  • writeCompleteFile() no longer produces a false warning when writing an empty file
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/util-file.h

    r1153 r1331  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2024  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    1212#include <stdio.h>
    1313#endif
     14#include <common/nonstd_span.h>
    1415
    1516bool readCompleteFile(const char* filename, vector<char>& data, bool warn_on_missing_file = true);
    1617bool readCompleteFile(const char* filename, string& out, bool warn_on_missing_file = true);
    1718bool writeCompleteFile(const char* filename, const std::string& text, bool warn_on_fail = true);
    18 bool writeCompleteFile(const char* filename, vector<char>& data, bool warn_on_fail = true);
     19bool writeCompleteFile(const char* filename, const span<char>& data, bool warn_on_fail = true);
     20bool writeCompleteFile(const char* filename, const span<uint8_t>& data, bool warn_on_fail = true);
     21bool writeCompleteFile(const char* filename, const vector<char>& data, bool warn_on_fail);
    1922#ifdef USE_VIRTFILE
    2023string readUntilEOL(VirtFILE *f);
Note: See TracChangeset for help on using the changeset viewer.