Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # tools/xcode/DarkRadiant.xcodeproj/project.pbxproj
- Loading branch information
Showing
54 changed files
with
1,590 additions
and
1,574 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#pragma once | ||
|
||
#include "iarchive.h" | ||
#include "stream/FileInputStream.h" | ||
|
||
namespace archive | ||
{ | ||
|
||
/// \brief An ArchiveFile which is stored as a single file on disk. | ||
class DirectoryArchiveFile : | ||
public ArchiveFile | ||
{ | ||
private: | ||
std::string _name; | ||
stream::FileInputStream _istream; | ||
stream::FileInputStream::size_type _size; | ||
|
||
public: | ||
typedef stream::FileInputStream::size_type size_type; | ||
|
||
DirectoryArchiveFile(const std::string& name, const std::string& filename) : | ||
_name(name), | ||
_istream(filename) | ||
{ | ||
if (!failed()) | ||
{ | ||
_istream.seek(0, stream::FileInputStream::end); | ||
_size = _istream.tell(); | ||
_istream.seek(0); | ||
} | ||
else | ||
{ | ||
_size = 0; | ||
} | ||
} | ||
|
||
bool failed() const | ||
{ | ||
return _istream.failed(); | ||
} | ||
|
||
size_type size() const override | ||
{ | ||
return _size; | ||
} | ||
|
||
const std::string& getName() const override | ||
{ | ||
return _name; | ||
} | ||
|
||
InputStream& getInputStream() override | ||
{ | ||
return _istream; | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#pragma once | ||
|
||
#include "iarchive.h" | ||
#include "stream/TextFileInputStream.h" | ||
|
||
namespace archive | ||
{ | ||
|
||
/// \brief An ArchiveTextFile which is stored as a single file on disk. | ||
class DirectoryArchiveTextFile : | ||
public ArchiveTextFile | ||
{ | ||
private: | ||
std::string _name; | ||
TextFileInputStream _inputStream; | ||
|
||
// Mod directory | ||
std::string _modName; | ||
|
||
public: | ||
|
||
DirectoryArchiveTextFile(const std::string& name, | ||
const std::string& modName, | ||
const std::string& filename) : | ||
_name(name), | ||
_inputStream(filename), | ||
_modName(modName) | ||
{} | ||
|
||
bool failed() const | ||
{ | ||
return _inputStream.failed(); | ||
} | ||
|
||
const std::string& getName() const override | ||
{ | ||
return _name; | ||
} | ||
|
||
TextInputStream& getInputStream() override | ||
{ | ||
return _inputStream; | ||
} | ||
|
||
/** | ||
* Get mod directory. | ||
*/ | ||
std::string getModName() const override | ||
{ | ||
return _modName; | ||
} | ||
}; | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.