1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-29 22:35:45 +00:00
Aquaria/ExternalLibs/ttvfs/ttvfs.h

81 lines
2.3 KiB
C
Raw Normal View History

/* ttvfs -- tiny tree virtual file system
2014-04-06 17:19:33 +00:00
// ttvfs.h - all the necessary includes to get a basic VFS working
// Only include externally, not inside the library.
See VFSDefines.h for compile configration.
---------[ License ]----------
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef TTVFS_VFS_H
#define TTVFS_VFS_H
#include "VFSDefines.h"
2014-04-06 17:19:33 +00:00
#include <cstring>
VFS_NAMESPACE_START
2014-04-06 17:19:33 +00:00
bool _checkCompatInternal(_AbiCheck *abi);
/** It is recommended to call this function early in your code
and ensure it returns true - if it does not, compiler settings
are inconsistent, which may cause otherwise hard to detect problems. */
2014-04-06 17:19:33 +00:00
inline static bool checkCompat()
{
2014-04-06 17:19:33 +00:00
_AbiCheck abi;
memset(&abi, 0, sizeof(abi));
abi.structSize = sizeof(abi);
abi.vfsposSize = sizeof(vfspos);
#ifdef VFS_LARGEFILE_SUPPORT
2014-04-06 17:19:33 +00:00
abi.largefile = 1;
#endif
#ifdef VFS_IGNORE_CASE
2014-04-06 17:19:33 +00:00
abi.nocase = 1;
#endif
2014-04-06 17:19:33 +00:00
return _checkCompatInternal(&abi);
}
VFS_NAMESPACE_END
#include <string>
2014-04-06 17:19:33 +00:00
#include "VFSRoot.h"
#include "VFSFile.h"
#include "VFSDir.h"
2014-04-06 17:19:33 +00:00
#include "VFSDirView.h"
#include "VFSSystemPaths.h"
2014-04-06 17:19:33 +00:00
#include "VFSTools.h"
#include "VFSLoader.h"
// Check to enforce correct including.
#ifdef VFS_INTERNAL_H
#error Oops, VFS_INTERNAL_H is defined, someone messed up and included VFSInternal.h wrongly.
#endif
#endif