Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
FileManagement.inl
Go to the documentation of this file.
1/*
2Copyright (c) 2018 DIVIDE-Studio
3Copyright (c) 2009 Ionut Cava
4
5This file is part of DIVIDE Framework.
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software
9and associated documentation files (the "Software"), to deal in the Software
10without restriction,
11including without limitation the rights to use, copy, modify, merge, publish,
12distribute, sublicense,
13and/or sell copies of the Software, and to permit persons to whom the
14Software is furnished to do so,
15subject to the following conditions:
16
17The above copyright notice and this permission notice shall be included in
18all copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21IMPLIED,
22INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23PARTICULAR PURPOSE AND NONINFRINGEMENT.
24IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25DAMAGES OR OTHER LIABILITY,
26WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27IN CONNECTION WITH THE SOFTWARE
28OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30*/
31
32#ifndef DVD_PLATFORM_FILE_FILE_MANAGEMENT_INL_
33#define DVD_PLATFORM_FILE_FILE_MANAGEMENT_INL_
34
36
37namespace Divide {
38
39inline FileError writeFile( const ResourcePath& filePath, const std::string_view fileName, const bufferPtr content, const size_t length, const FileType fileType )
40{
41 return writeFile( filePath, fileName, static_cast<const char*>(content), length, fileType );
42}
43
44inline bool fileExists( const ResourcePath& filePath, const std::string_view fileName )
45{
46 return fileExists( filePath / fileName );
47}
48
49inline bool fileIsEmpty( const ResourcePath& filePath, const std::string_view fileName )
50{
51 return fileIsEmpty( filePath / fileName );
52}
53
54inline FileError fileLastWriteTime( const ResourcePath& filePath, const std::string_view fileName, U64& timeOutSec )
55{
56 return fileLastWriteTime( filePath / fileName, timeOutSec );
57}
58
59inline FileError openFile( const ResourcePath& filePath, const std::string_view fileName )
60{
61 return openFile( "", filePath, fileName );
62}
63
64}; //namespace Divide
65
66#endif //DVD_PLATFORM_FILE_FILE_MANAGEMENT_INL_
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
FileError openFile(const std::string_view cmd, const ResourcePath &filePath, const std::string_view fileName)
FileError writeFile(const ResourcePath &filePath, const std::string_view fileName, const char *content, const size_t length, const FileType fileType)
bool fileIsEmpty(const ResourcePath &filePathAndName)
bool fileExists(const ResourcePath &filePathAndName)
void * bufferPtr
uint64_t U64
FileError fileLastWriteTime(const ResourcePath &filePathAndName, U64 &timeOutSec)