Tide 0.1.0

ebml_int.h

Go to the documentation of this file.
00001 /* Tide
00002  *
00003  * Coded integer header file.
00004  *
00005  * Copyright 2011 Geoffrey Biggs geoffrey.biggs@aist.go.jp
00006  *     RT-Synthesis Research Group
00007  *     Intelligent Systems Research Institute,
00008  *     National Institute of Advanced Industrial Science and Technology (AIST),
00009  *     Japan
00010  *     All rights reserved.
00011  *
00012  * This file is part of Tide.
00013  *
00014  * Tide is free software; you can redistribute it and/or modify it under
00015  * the terms of the GNU Lesser General Public License as published by
00016  * the Free Software Foundation; either version 2.1 of the License, or
00017  * (at your option) any later version.
00018  *
00019  * Tide is distributed in the hope that it will be useful, but WITHOUT
00020  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00021  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00022  * License for more details.
00023  *
00024  * You should have received a copy of the GNU Lesser General Public
00025  * License along with Tide. If not, see <http://www.gnu.org/licenses/>.
00026  */
00027 
00028 #if !defined(TIDE_EBML_INT_H_)
00029 #define TIDE_EBML_INT_H_
00030 
00031 #include <cstddef>
00032 #include <istream>
00033 #include <ostream>
00034 #include <stdint.h>
00035 #include <vector>
00036 
00037 namespace tide
00038 {
00054     namespace ebml_int
00055     {
00065         std::streamsize size_u(uint64_t integer);
00066 
00076         std::streamsize size_s(int64_t integer);
00077 
00086         std::vector<char> encode_u(uint64_t integer);
00087 
00096         std::vector<char> encode_s(int64_t integer);
00097 
00109         std::streamsize write_u(uint64_t integer, std::ostream& output);
00110 
00122         std::streamsize write_s(int64_t integer, std::ostream& output);
00123 
00134         uint64_t decode_u(std::vector<char> const& buffer);
00135 
00146         int64_t decode_s(std::vector<char> const& buffer);
00147 
00159         uint64_t read_u(std::istream& input, std::streamsize n);
00160 
00172         int64_t read_s(std::istream& input, std::streamsize n);
00173     }; // namespace ebml_int
00174 }; // namespace tide
00175 
00176 #endif // TIDE_EBML_INT_H_
00177 
00178 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines