First commit
This commit is contained in:
64
include/Nazara/Core/Directory.hpp
Normal file
64
include/Nazara/Core/Directory.hpp
Normal file
@@ -0,0 +1,64 @@
|
||||
// Copyright (C) 2012 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine".
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_DIRECTORY_HPP
|
||||
#define NAZARA_DIRECTORY_HPP
|
||||
|
||||
#define NAZARA_DIRECTORY
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/String.hpp>
|
||||
#include <Nazara/Core/ThreadSafety.hpp>
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#define NAZARA_DIRECTORY_SEPARATOR '\\'
|
||||
#elif defined(NAZARA_PLATFORM_LINUX)
|
||||
#define NAZARA_DIRECTORY_SEPARATOR '/'
|
||||
#else
|
||||
#error OS not handled
|
||||
#define NAZARA_DIRECTORY_SEPARATOR '/'
|
||||
#endif
|
||||
|
||||
class NzDirectoryImpl;
|
||||
|
||||
class NAZARA_API NzDirectory
|
||||
{
|
||||
public:
|
||||
NzDirectory();
|
||||
NzDirectory(const NzString& dirPath);
|
||||
~NzDirectory();
|
||||
|
||||
void Close();
|
||||
|
||||
NzString GetResultName() const;
|
||||
NzString GetResultPath() const;
|
||||
nzUInt64 GetResultSize() const;
|
||||
|
||||
bool IsResultDirectory() const;
|
||||
|
||||
bool NextResult(bool skipDots = true);
|
||||
|
||||
bool Open();
|
||||
|
||||
void SetDirectory(const NzString& dirPath);
|
||||
|
||||
static bool Copy(const NzString& sourcePath, const NzString& destPath);
|
||||
static bool Create(const NzString& dirPath, bool recursive = false);
|
||||
static bool Exists(const NzString& dirPath);
|
||||
static NzString GetCurrent();
|
||||
static bool Remove(const NzString& dirPath, bool emptyDirectory = false);
|
||||
static bool SetCurrent(const NzString& dirPath);
|
||||
|
||||
private:
|
||||
NazaraMutexAttrib(m_mutex, mutable)
|
||||
|
||||
NzString m_dirPath;
|
||||
NzDirectoryImpl* m_impl;
|
||||
};
|
||||
|
||||
#undef NAZARA_DIRECTORY
|
||||
|
||||
#endif // NAZARA_DIRECTORY_HPP
|
||||
Reference in New Issue
Block a user