mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-22 11:22:38 -04:00
+ fix
This commit is contained in:
parent
44d9a1abd8
commit
fef93ed3b4
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <zim/zim.h>
|
||||||
|
|
||||||
/// Returns true, if machine is big-endian (high byte first).
|
/// Returns true, if machine is big-endian (high byte first).
|
||||||
/// e.g. PowerPC
|
/// e.g. PowerPC
|
||||||
|
@ -51,6 +51,7 @@ namespace zim
|
|||||||
|
|
||||||
Article getArticle(size_type idx) const;
|
Article getArticle(size_type idx) const;
|
||||||
Article getArticle(char ns, const std::string& url);
|
Article getArticle(char ns, const std::string& url);
|
||||||
|
Article getArticleByUrl(const std::string& url);
|
||||||
Article getArticleByTitle(size_type idx);
|
Article getArticleByTitle(size_type idx);
|
||||||
Article getArticleByTitle(char ns, const std::string& title);
|
Article getArticleByTitle(char ns, const std::string& title);
|
||||||
|
|
||||||
@ -77,10 +78,12 @@ namespace zim
|
|||||||
const_iterator begin();
|
const_iterator begin();
|
||||||
const_iterator beginByTitle();
|
const_iterator beginByTitle();
|
||||||
const_iterator end();
|
const_iterator end();
|
||||||
std::pair<bool, const_iterator> findxByTitle(char ns, const std::string& title);
|
|
||||||
std::pair<bool, const_iterator> findx(char ns, const std::string& url);
|
std::pair<bool, const_iterator> findx(char ns, const std::string& url);
|
||||||
|
std::pair<bool, const_iterator> findx(const std::string& url);
|
||||||
|
std::pair<bool, const_iterator> findxByTitle(char ns, const std::string& title);
|
||||||
const_iterator findByTitle(char ns, const std::string& title);
|
const_iterator findByTitle(char ns, const std::string& title);
|
||||||
const_iterator find(char ns, const std::string& url);
|
const_iterator find(char ns, const std::string& url);
|
||||||
|
const_iterator find(const std::string& url);
|
||||||
|
|
||||||
bool good() const { return impl.getPointer() != 0; }
|
bool good() const { return impl.getPointer() != 0; }
|
||||||
time_t getMTime() const { return impl->getMTime(); }
|
time_t getMTime() const { return impl->getMTime(); }
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <locale>
|
#include <locale>
|
||||||
#include <stdint.h>
|
#include <zim/zim.h>
|
||||||
|
|
||||||
namespace zim
|
namespace zim
|
||||||
{
|
{
|
||||||
|
@ -24,17 +24,27 @@
|
|||||||
|
|
||||||
namespace zim
|
namespace zim
|
||||||
{
|
{
|
||||||
|
// define 8 bit integer types
|
||||||
|
//
|
||||||
|
typedef unsigned char uint8_t;
|
||||||
|
typedef char int8_t;
|
||||||
|
|
||||||
|
// define 16 bit integer types
|
||||||
|
//
|
||||||
#if USHRT_MAX == 0xffff
|
#if USHRT_MAX == 0xffff
|
||||||
|
|
||||||
typedef unsigned short uint16_t;
|
typedef unsigned short uint16_t;
|
||||||
|
typedef short int16_t;
|
||||||
|
|
||||||
#elif UINT_MAX == 0xffff
|
#elif UINT_MAX == 0xffff
|
||||||
|
|
||||||
typedef unsigned int uint16_t;
|
typedef unsigned int uint16_t;
|
||||||
|
typedef int int16_t;
|
||||||
|
|
||||||
#elif ULONG_MAX == 0xffff
|
#elif ULONG_MAX == 0xffff
|
||||||
|
|
||||||
typedef unsigned long uint16_t;
|
typedef unsigned long uint16_t;
|
||||||
|
typedef long int16_t;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@ -45,17 +55,22 @@ namespace zim
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// define 32 bit integer types
|
||||||
|
//
|
||||||
#if USHRT_MAX == 0xffffffffUL
|
#if USHRT_MAX == 0xffffffffUL
|
||||||
|
|
||||||
typedef unsigned short size_type;
|
typedef unsigned short uint32_t;
|
||||||
|
typedef short int32_t;
|
||||||
|
|
||||||
#elif UINT_MAX == 0xffffffffUL
|
#elif UINT_MAX == 0xffffffffUL
|
||||||
|
|
||||||
typedef unsigned int size_type;
|
typedef unsigned int uint32_t;
|
||||||
|
typedef int int32_t;
|
||||||
|
|
||||||
#elif ULONG_MAX == 0xffffffffUL
|
#elif ULONG_MAX == 0xffffffffUL
|
||||||
|
|
||||||
typedef unsigned long size_type;
|
typedef unsigned long uint32_t;
|
||||||
|
typedef long int32_t;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@ -63,21 +78,25 @@ namespace zim
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
namespace zim
|
namespace zim
|
||||||
{
|
{
|
||||||
typedef uint32_t size_type;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// define 64 bit integer types
|
||||||
|
//
|
||||||
#if UINT_MAX == 18446744073709551615ULL
|
#if UINT_MAX == 18446744073709551615ULL
|
||||||
|
|
||||||
typedef unsigned int offset_type;
|
typedef unsigned int uint64_t;
|
||||||
|
typedef int int64_t;
|
||||||
|
|
||||||
#elif ULONG_MAX == 18446744073709551615ULL
|
#elif ULONG_MAX == 18446744073709551615ULL
|
||||||
|
|
||||||
typedef unsigned long offset_type;
|
typedef unsigned long uint64_t;
|
||||||
|
typedef long int64_t;
|
||||||
|
|
||||||
#elif ULLONG_MAX == 18446744073709551615ULL
|
#elif ULLONG_MAX == 18446744073709551615ULL
|
||||||
|
|
||||||
typedef unsigned long long offset_type;
|
typedef unsigned long long uint64_t;
|
||||||
|
typedef long long int64_t;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@ -85,10 +104,11 @@ namespace zim
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
namespace zim
|
namespace zim
|
||||||
{
|
{
|
||||||
typedef uint64_t offset_type;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef uint32_t size_type;
|
||||||
|
typedef uint64_t offset_type;
|
||||||
|
|
||||||
enum CompressionType
|
enum CompressionType
|
||||||
{
|
{
|
||||||
zimcompDefault,
|
zimcompDefault,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user