|
NX 1.0.3
niu2x's base c++ helper library
|
root namespace 更多...
命名空间 | |
| namespace | cmd |
| namespace | digest |
| digest namespace | |
| namespace | file_system |
| file_system namespace | |
| namespace | logging |
类 | |
| struct | EndOfFile |
| End of file, a Unit struct. 更多... | |
| struct | IO_Success |
| Result of successful io operation 更多... | |
| class | MemoryFile |
| class | Read |
| class | Uncopyable |
| 用于被private继承, 子类将不可被Copy 更多... | |
| class | Write |
类型定义 | |
| using | CRC32 = nx::digest::CRC32 |
| using | MD5 = nx::digest::MD5 |
| using | SHA256 = nx::digest::SHA256 |
| using | ByteBuffer = std::vector< uint8_t > |
| byte array | |
| template<class T > | |
| using | Optional = std::optional< T > |
| template<class T > | |
| using | Vector = std::vector< T > |
| template<class T > | |
| using | Queue = std::queue< T > |
| using | String = std::string |
| template<class... T> | |
| using | Variant = std::variant< T... > |
| template<class T > | |
| using | UniquePtr = std::unique_ptr< T > |
| template<class T > | |
| using | SharedPtr = std::shared_ptr< T > |
| template<class K , class V > | |
| using | Map = std::map< K, V > |
| template<class T > | |
| using | Function = std::function< T > |
| template<class T > | |
| using | List = std::list< T > |
| using | ReadResult = Variant< IO_Error, EndOfFile, IO_Success > |
| Result of a read operation | |
| using | ReadAllResult = Variant< IO_Error, ByteBuffer > |
| using | WriteResult = Variant< IO_Error, IO_Success > |
| Result of a write operation | |
| using | TimePoint = std::chrono::time_point< std::chrono::system_clock > |
| using | TimeDuration = int64_t |
| milliseconds | |
枚举 | |
| enum class | OpenMode { WRITE , READ } |
| Open Mode 更多... | |
| enum class | IO_Error { NOT_OPEN , IO_FAIL } |
| IO Error 更多... | |
函数 | |
| NX_API void | panic_fmt (const char *fmt,...) |
| constexpr size_t | operator""_kb (unsigned long long int n) |
| NX_API bool | pipe (Read &reader, Write &writer) |
| pipe data from reader to writer | |
| NX_API bool | pipe (Read *reader, Write *writer) |
| TimePoint | time_now () |
| get current clock time | |
| TimeDuration | time_diff (const TimePoint &t_old, const TimePoint &t_new) |
| calculate time duration before old and now | |
| TimeDuration | time_diff_epoch (const TimePoint &t) |
| uint8_t | ceil_pow2 (uint8_t n) |
| uint16_t | ceil_pow2 (uint16_t n) |
| uint32_t | ceil_pow2 (uint32_t n) |
| uint64_t | ceil_pow2 (uint64_t n) |
| template<class T > | |
| bool | is_pow2 (T x) |
| NX_API ByteBuffer | zlib_compress (const uint8_t *buf, size_t len) |
| NX_API ByteBuffer | zlib_uncompress (const uint8_t *buf, size_t len) |
root namespace
| using nx::ByteBuffer = typedef std::vector<uint8_t> |
byte array
| using nx::CRC32 = typedef nx::digest::CRC32 |
| using nx::Function = typedef std::function<T> |
| using nx::List = typedef std::list<T> |
| using nx::Map = typedef std::map<K, V> |
| using nx::MD5 = typedef nx::digest::MD5 |
| using nx::Optional = typedef std::optional<T> |
| using nx::Queue = typedef std::queue<T> |
| using nx::ReadAllResult = typedef Variant<IO_Error, ByteBuffer> |
| using nx::ReadResult = typedef Variant<IO_Error, EndOfFile, IO_Success> |
Result of a read operation
| using nx::SHA256 = typedef nx::digest::SHA256 |
| using nx::SharedPtr = typedef std::shared_ptr<T> |
| using nx::String = typedef std::string |
| using nx::TimeDuration = typedef int64_t |
milliseconds
| using nx::TimePoint = typedef std::chrono::time_point<std::chrono::system_clock> |
| using nx::UniquePtr = typedef std::unique_ptr<T> |
| using nx::Variant = typedef std::variant<T...> |
| using nx::Vector = typedef std::vector<T> |
| using nx::WriteResult = typedef Variant<IO_Error, IO_Success> |
Result of a write operation
|
strong |
|
strong |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
constexpr |
| NX_API void nx::panic_fmt | ( | const char * | fmt, |
| ... | |||
| ) |
pipe data from reader to writer
| reader | The reader |
| writer | The writer |
|
inline |
calculate time duration before old and now
| [in] | t_old | The old timepoint |
| [in] | t_new | The now timepoint |
|
inline |
|
inline |
get current clock time
| NX_API ByteBuffer nx::zlib_compress | ( | const uint8_t * | buf, |
| size_t | len | ||
| ) |
| NX_API ByteBuffer nx::zlib_uncompress | ( | const uint8_t * | buf, |
| size_t | len | ||
| ) |