Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
Argent77 committed May 11, 2015
2 parents 7643da6 + b681792 commit f9448ba
Show file tree
Hide file tree
Showing 17 changed files with 634 additions and 675 deletions.
2 changes: 2 additions & 0 deletions tileconv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ else
ifeq ($(shell uname -s),Darwin)
# A few hacks to enable proper threading support
CXXFLAGS += -D_GLIBCXX_USE_NANOSLEEP
# Don't assume that standard libraries are available on the target system
LDFLAGS += -static-libstdc++ -static-libgcc
else
# Nothing to do for Linux (yet)
endif
Expand Down
5 changes: 4 additions & 1 deletion tileconv/README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TILECONV
~~~~~~~~

Version: 0.5
Version: 0.5.1
Author: Argent77

This tool allows you to compress or decompress TIS and MOS files provided by
Expand Down Expand Up @@ -128,3 +128,6 @@ v0.5 (2014-09-18)
* Added TIZ/MOZ decompression support
* Option -T is recognized by option -I
* Incomplete output files are deleted on error

v0.5.1 (2015-05-10)
* Fixed potential issues with the Mac OS X version
20 changes: 20 additions & 0 deletions tileconv/fileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ File::File(const char *fileName, const char *mode) noexcept
}
}


File::File(const char *fileName, const char *mode, int bufferSize) noexcept
: m_file(0)
, m_fileName()
Expand All @@ -100,6 +101,7 @@ File::File(const char *fileName, const char *mode, int bufferSize) noexcept
}
}


File::~File() noexcept
{
if (m_file != nullptr) {
Expand All @@ -116,6 +118,7 @@ File::~File() noexcept
}
}


bool File::reopen(const char *fileName, const char *mode) noexcept
{
if (m_file) {
Expand All @@ -132,6 +135,7 @@ bool File::reopen(const char *fileName, const char *mode) noexcept
return false;
}


bool File::flush() noexcept
{
if (m_file) {
Expand All @@ -140,6 +144,7 @@ bool File::flush() noexcept
return false;
}


std::size_t File::read(void *buffer, std::size_t size, std::size_t count) noexcept
{
if (m_file) {
Expand All @@ -148,6 +153,7 @@ std::size_t File::read(void *buffer, std::size_t size, std::size_t count) noexce
return 0;
}


std::size_t File::write(const void *buffer, std::size_t size, std::size_t count) noexcept
{
if (m_file) {
Expand All @@ -156,6 +162,7 @@ std::size_t File::write(const void *buffer, std::size_t size, std::size_t count)
return 0;
}


int File::getc() noexcept
{
if (m_file) {
Expand All @@ -164,6 +171,7 @@ int File::getc() noexcept
return EOF;
}


char* File::gets(char *str, int count) noexcept
{
if (m_file) {
Expand All @@ -172,6 +180,7 @@ char* File::gets(char *str, int count) noexcept
return NULL;
}


int File::putc(int ch) noexcept
{
if (m_file) {
Expand All @@ -180,6 +189,7 @@ int File::putc(int ch) noexcept
return EOF;
}


int File::puts(const char *str) noexcept
{
if (m_file) {
Expand All @@ -188,6 +198,7 @@ int File::puts(const char *str) noexcept
return EOF;
}


int File::ungetc(int ch) noexcept
{
if (m_file) {
Expand All @@ -196,6 +207,7 @@ int File::ungetc(int ch) noexcept
return EOF;
}


long File::tell() noexcept
{
if (m_file) {
Expand All @@ -204,6 +216,7 @@ long File::tell() noexcept
return -1L;
}


bool File::getpos(std::fpos_t *pos) noexcept
{
if (m_file) {
Expand All @@ -212,6 +225,7 @@ bool File::getpos(std::fpos_t *pos) noexcept
return false;
}


bool File::seek(long offset, int origin) noexcept
{
if (m_file) {
Expand All @@ -220,6 +234,7 @@ bool File::seek(long offset, int origin) noexcept
return false;
}


bool File::setpos(const std::fpos_t *pos) noexcept
{
if (m_file) {
Expand All @@ -228,20 +243,23 @@ bool File::setpos(const std::fpos_t *pos) noexcept
return false;
}


void File::rewind() noexcept
{
if (m_file) {
std::rewind(m_file);
}
}


void File::clearerr() noexcept
{
if (m_file) {
std::clearerr(m_file);
}
}


bool File::eof() noexcept
{
if (m_file) {
Expand All @@ -250,6 +268,7 @@ bool File::eof() noexcept
return true;
}


bool File::error() noexcept
{
if (m_file) {
Expand All @@ -258,6 +277,7 @@ bool File::error() noexcept
return true;
}


void File::perror(const char *s) noexcept
{
std::perror(s);
Expand Down
7 changes: 7 additions & 0 deletions tileconv/fileio.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ class File
/** Returns whether current file is writable. */
bool isWriteEnabled() const noexcept;

private:
/** Not copyable. */
File(const File &) = delete;

/** Not assignable. */
File& operator=(const File &) = delete;

private:
std::FILE *m_file; // current file handle
std::string m_fileName; // filename
Expand Down
Loading

0 comments on commit f9448ba

Please sign in to comment.