diff options
author | Adrian Kummerlaender | 2017-10-06 14:26:44 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2017-10-06 14:26:44 +0200 |
commit | 538236772ce6edde390079c32533c1e70cf8bdca (patch) | |
tree | 1303d22cb092bcf8bb5fadbe4b0ea886eceb1ffa /example.cc | |
parent | c953c72c86c281d650b2a8ff856e3d614664e11a (diff) | |
download | DictzipQuery-538236772ce6edde390079c32533c1e70cf8bdca.tar DictzipQuery-538236772ce6edde390079c32533c1e70cf8bdca.tar.gz DictzipQuery-538236772ce6edde390079c32533c1e70cf8bdca.tar.bz2 DictzipQuery-538236772ce6edde390079c32533c1e70cf8bdca.tar.lz DictzipQuery-538236772ce6edde390079c32533c1e70cf8bdca.tar.xz DictzipQuery-538236772ce6edde390079c32533c1e70cf8bdca.tar.zst DictzipQuery-538236772ce6edde390079c32533c1e70cf8bdca.zip |
Implement BASE64 decoding of locations given by dictionary index
Diffstat (limited to 'example.cc')
-rw-r--r-- | example.cc | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1,4 +1,5 @@ #include "istream/stream.h" +#include "util/base64.h" #include <string> #include <iostream> @@ -6,12 +7,16 @@ int main() { dictzip::Istream stream("gcide.dict.dz"); + // Decode location of _Accession_ + const std::size_t offset = dictzip::base64_decode("8Aw"); + const std::size_t length = dictzip::base64_decode("Wt"); + // Print the GCIDE definition of _Accession_ std::string data; - data.reserve(1453); + data.reserve(length); - stream.seekg(245808); - stream.read(const_cast<char*>(data.data()), 1453); + stream.seekg(offset); + stream.read(const_cast<char*>(data.data()), length); std::cout << data.c_str() << std::endl; } |