Navigation Menu

Skip to content

Commit

Permalink
Remove old modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yata committed Jun 28, 2013
1 parent c88bb1e commit 8d32cfc
Show file tree
Hide file tree
Showing 90 changed files with 116 additions and 231 deletions.
8 changes: 0 additions & 8 deletions .gitignore
Expand Up @@ -27,30 +27,22 @@ missing
src/grnxx
stamp-h1
temp/
test/test_alpha_double_array
test/test_alpha_map
test/test_array
test/test_backtrace
test/test_bytes
test/test_charset
test/test_db_blob_vector
test/test_db_vector
test/test_duration
test/test_error
test/test_exception
test/test_features
test/test_geo_point
test/test_grnxx
test/test_intrinsic
test/test_io
test/test_logger
test/test_map
test/test_mutex
test/test_os
test/test_recycler
test/test_slice
test/test_storage
test/test_string
test/test_string_builder
test/test_string_format
test/test_thread
Expand Down
4 changes: 0 additions & 4 deletions configure.ac
Expand Up @@ -60,11 +60,7 @@ AC_CHECK_LIB([pthread], [pthread_create],
AC_CONFIG_FILES([Makefile
lib/Makefile
lib/grnxx/Makefile
lib/grnxx/alpha/Makefile
lib/grnxx/alpha/map/Makefile
lib/grnxx/charset/Makefile
lib/grnxx/db/Makefile
lib/grnxx/io/Makefile
lib/grnxx/map/Makefile
lib/grnxx/map/array_map/Makefile
lib/grnxx/map/double_array/Makefile
Expand Down
14 changes: 0 additions & 14 deletions lib/grnxx/Makefile.am
@@ -1,18 +1,12 @@
SUBDIRS = \
alpha \
charset \
db \
io \
map \
storage

lib_LTLIBRARIES = libgrnxx.la

libgrnxx_la_LIBADD = \
alpha/libgrnxx_alpha.la \
charset/libgrnxx_charset.la \
db/libgrnxx_db.la \
io/libgrnxx_io.la \
map/libgrnxx_map.la \
storage/libgrnxx_storage.la

Expand All @@ -23,7 +17,6 @@ libgrnxx_la_SOURCES = \
array_impl.cpp \
backtrace.cpp \
broken_down_time.cpp \
bytes.cpp \
charset.cpp \
duration.cpp \
error.cpp \
Expand All @@ -36,11 +29,8 @@ libgrnxx_la_SOURCES = \
mutex.cpp \
os.cpp \
periodic_clock.cpp \
recycler.cpp \
slice.cpp \
stopwatch.cpp \
storage.cpp \
string.cpp \
string_builder.cpp \
system_clock.cpp \
thread.cpp \
Expand All @@ -51,7 +41,6 @@ libgrnxx_include_HEADERS = \
array.hpp \
array_impl.hpp \
backtrace.hpp \
basic.hpp \
broken_down_time.hpp \
bytes.hpp \
charset.hpp \
Expand All @@ -72,11 +61,8 @@ libgrnxx_include_HEADERS = \
mutex.hpp \
os.hpp \
periodic_clock.hpp \
recycler.hpp \
slice.hpp \
stopwatch.hpp \
storage.hpp \
string.hpp \
string_builder.hpp \
string_format.hpp \
system_clock.hpp \
Expand Down
1 change: 1 addition & 0 deletions lib/grnxx/backtrace.cpp
Expand Up @@ -35,6 +35,7 @@
#endif // HAVE_LIBBFD

#include <cstdlib>
#include <cstring>
#include <sstream>

#include "grnxx/lock.hpp"
Expand Down
30 changes: 0 additions & 30 deletions lib/grnxx/bytes.cpp

This file was deleted.

4 changes: 0 additions & 4 deletions lib/grnxx/bytes.hpp
Expand Up @@ -26,8 +26,6 @@

namespace grnxx {

class StringBuilder;

// A reference to a sequence of bytes.
class Bytes {
public:
Expand Down Expand Up @@ -165,8 +163,6 @@ inline bool operator>=(const char *lhs, const Bytes &rhs) {
return Bytes(lhs) >= rhs;
}

StringBuilder &operator<<(StringBuilder &builder, const Bytes &bytes);

} // namespace

#endif // GRNXX_BYTES_HPP
11 changes: 0 additions & 11 deletions lib/grnxx/charset.hpp
Expand Up @@ -23,9 +23,6 @@
#include "grnxx/bytes.hpp"
#include "grnxx/types.hpp"

// TODO: To be removed in future.
#include "grnxx/slice.hpp"

namespace grnxx {

class StringBuilder;
Expand Down Expand Up @@ -58,14 +55,6 @@ class Charset {
// Return the size of the first character of "bytes". This function may
// return 0 if "bytes" is empty or an invalid sequence.
virtual size_t get_char_size(const Bytes &bytes) const = 0;

// TODO: To be removed in future.
// Return the first character of "slice". This function may return an empty
// slice if "slice" is empty or an invalid sequence.
virtual Slice get_char(const Slice &slice) const = 0;
// Return the size of the first character of "slice". This function may
// return 0 if "slice" is empty or an invalid sequence.
virtual size_t get_char_size(const Slice &slice) const = 0;
};

} // namespace grnxx
Expand Down
8 changes: 0 additions & 8 deletions lib/grnxx/charset/euc-jp.cpp
Expand Up @@ -76,13 +76,5 @@ size_t EUC_JP::get_char_size(const Bytes &bytes) const {
return 1;
}

Slice EUC_JP::get_char(const Slice &slice) const {
return slice.prefix(get_char_size(slice));
}

size_t EUC_JP::get_char_size(const Slice &slice) const {
return get_char_size(Bytes(slice.ptr(), slice.size()));
}

} // namespace charset
} // namespace grnxx
7 changes: 0 additions & 7 deletions lib/grnxx/charset/euc-jp.hpp
Expand Up @@ -23,9 +23,6 @@
#include "grnxx/bytes.hpp"
#include "grnxx/charset.hpp"

// TODO: To be removed in future.
#include "grnxx/slice.hpp"

namespace grnxx {
namespace charset {

Expand All @@ -38,10 +35,6 @@ class EUC_JP : public Charset {

Bytes get_char(const Bytes &bytes) const;
size_t get_char_size(const Bytes &bytes) const;

// TODO: To be removed in future.
Slice get_char(const Slice &slice) const;
size_t get_char_size(const Slice &slice) const;
};

} // namespace charset
Expand Down
8 changes: 0 additions & 8 deletions lib/grnxx/charset/shift_jis.cpp
Expand Up @@ -54,13 +54,5 @@ size_t Shift_JIS::get_char_size(const Bytes &bytes) const {
return 1;
}

Slice Shift_JIS::get_char(const Slice &slice) const {
return slice.prefix(get_char_size(slice));
}

size_t Shift_JIS::get_char_size(const Slice &slice) const {
return get_char_size(Bytes(slice.ptr(), slice.size()));
}

} // namespace charset
} // namespace grnxx
7 changes: 0 additions & 7 deletions lib/grnxx/charset/shift_jis.hpp
Expand Up @@ -23,9 +23,6 @@
#include "grnxx/bytes.hpp"
#include "grnxx/charset.hpp"

// TODO: To be removed in future.
#include "grnxx/slice.hpp"

namespace grnxx {
namespace charset {

Expand All @@ -38,10 +35,6 @@ class Shift_JIS : public Charset {

Bytes get_char(const Bytes &bytes) const;
size_t get_char_size(const Bytes &bytes) const;

// TODO: To be removed in future.
Slice get_char(const Slice &slice) const;
size_t get_char_size(const Slice &slice) const;
};

} // namespace charset
Expand Down
9 changes: 1 addition & 8 deletions lib/grnxx/charset/utf-8.cpp
Expand Up @@ -17,6 +17,7 @@
*/
#include "grnxx/charset/utf-8.hpp"

#include "grnxx/bytes.hpp"
#include "grnxx/intrinsic.hpp"

namespace grnxx {
Expand Down Expand Up @@ -79,13 +80,5 @@ size_t UTF_8::get_char_size(const Bytes &bytes) const {
return 1;
}

Slice UTF_8::get_char(const Slice &slice) const {
return slice.prefix(get_char_size(slice));
}

size_t UTF_8::get_char_size(const Slice &slice) const {
return get_char_size(Bytes(slice.ptr(), slice.size()));
}

} // namespace charset
} // namespace grnxx
7 changes: 0 additions & 7 deletions lib/grnxx/charset/utf-8.hpp
Expand Up @@ -23,9 +23,6 @@
#include "grnxx/bytes.hpp"
#include "grnxx/charset.hpp"

// TODO: To be removed in future.
#include "grnxx/slice.hpp"

namespace grnxx {
namespace charset {

Expand All @@ -38,10 +35,6 @@ class UTF_8 : public Charset {

Bytes get_char(const Bytes &bytes) const;
size_t get_char_size(const Bytes &bytes) const;

// TODO: To be removed in future.
Slice get_char(const Slice &slice) const;
size_t get_char_size(const Slice &slice) const;
};

} // namespace charset
Expand Down
4 changes: 3 additions & 1 deletion lib/grnxx/exception.hpp
Expand Up @@ -18,7 +18,9 @@
#ifndef GRNXX_EXCEPTION_HPP
#define GRNXX_EXCEPTION_HPP

#include "grnxx/basic.hpp"
#include "grnxx/features.hpp"

#include <exception>

#define GRNXX_THROW() (throw ::grnxx::Exception())

Expand Down
6 changes: 4 additions & 2 deletions lib/grnxx/lock.hpp
Expand Up @@ -18,7 +18,9 @@
#ifndef GRNXX_LOCK_HPP
#define GRNXX_LOCK_HPP

#include "grnxx/basic.hpp"
#include "grnxx/features.hpp"

#include "grnxx/duration.hpp"
#include "grnxx/mutex.hpp"

namespace grnxx {
Expand All @@ -28,7 +30,7 @@ class Lock {
Lock() = delete;
explicit Lock(Mutex *mutex) : mutex_((mutex->lock(), mutex)) {}
Lock(Mutex *mutex, Duration timeout)
: mutex_(mutex->lock(timeout) ? mutex : nullptr) {}
: mutex_(mutex->lock(timeout) ? mutex : nullptr) {}
~Lock() {
if (mutex_) {
mutex_->unlock();
Expand Down
9 changes: 6 additions & 3 deletions lib/grnxx/logger.cpp
Expand Up @@ -20,6 +20,9 @@
#include <ctime>
#include <fstream>
#include <iostream>
#include <memory>
#include <string>
#include <vector>

#include "grnxx/backtrace.hpp"
#include "grnxx/lock.hpp"
Expand Down Expand Up @@ -69,7 +72,7 @@ class LoggerSingleton {
return false;
}
try {
String path_dummy(path);
std::string path_dummy(path);
std::unique_ptr<std::ofstream> file_dummy(
new (std::nothrow) std::ofstream(path_dummy.c_str(),
std::ios::out | std::ios::app | std::ios::binary));
Expand All @@ -88,12 +91,12 @@ class LoggerSingleton {
Lock lock(&mutex_);
if (instance_) {
instance_->file_.reset();
instance_->path_ = String();
instance_->path_.clear();
}
}

private:
String path_;
std::string path_;
std::unique_ptr<std::ofstream> file_;

// These variables may be used even after the instance termination.
Expand Down
2 changes: 2 additions & 0 deletions lib/grnxx/logger.hpp
Expand Up @@ -20,7 +20,9 @@

#include "grnxx/features.hpp"

#include "grnxx/flags_impl.hpp"
#include "grnxx/string_builder.hpp"
#include "grnxx/types.hpp"

#define GRNXX_ERROR() GRNXX_LOGGER(::grnxx::ERROR_LOGGER)
#define GRNXX_WARNING() GRNXX_LOGGER(::grnxx::WARNING_LOGGER)
Expand Down
2 changes: 2 additions & 0 deletions lib/grnxx/map_cursor.cpp
Expand Up @@ -17,6 +17,8 @@
*/
#include "grnxx/map_cursor.hpp"

#include <limits>

#include "grnxx/bytes.hpp"
#include "grnxx/geo_point.hpp"
#include "grnxx/logger.hpp"
Expand Down
4 changes: 3 additions & 1 deletion lib/grnxx/storage/chunk_index.hpp
Expand Up @@ -18,7 +18,9 @@
#ifndef GRNXX_STORAGE_CHUNK_INDEX_HPP
#define GRNXX_STORAGE_CHUNK_INDEX_HPP

#include "grnxx/basic.hpp"
#include "grnxx/features.hpp"

#include "grnxx/types.hpp"

namespace grnxx {
namespace storage {
Expand Down
1 change: 1 addition & 0 deletions lib/grnxx/storage/file-posix.cpp
Expand Up @@ -26,6 +26,7 @@
#include <unistd.h>

#include <cerrno>
#include <limits>
#include <new>

#include "grnxx/error.hpp"
Expand Down

0 comments on commit 8d32cfc

Please sign in to comment.