zipios++  2.0.2
Zipios++ – a small C++ library that provides easy access to .zip files.
Namespaces | Macros | Typedefs | Functions
zipios_common.hpp File Reference

Various functions used throughout the library. More...

#include "zipios++/zipios-config.hpp"
#include <vector>
#include <sstream>
Include dependency graph for zipios_common.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 zipios
 The zipios namespace includes the Zipios++ library definitions.
 

Macros

#define ZIPIOS_COMMON_HPP
 

Typedefs

typedef std::vector< unsigned
char > 
zipios::buffer_t
 A buffer of characters. More...
 
typedef std::ostringstream zipios::OutputStringStream
 An output stream using strings. More...
 

Functions

template<class Type >
void operator+= (std::vector< Type > &v1, std::vector< Type > const &v2)
 Contatenate two vectors together. More...
 
void zipios::zipRead (std::istream &is, uint32_t &value)
 
void zipios::zipRead (std::istream &is, uint16_t &value)
 
void zipios::zipRead (std::istream &is, uint8_t &value)
 
void zipios::zipRead (std::istream &is, buffer_t &buffer, ssize_t const count)
 
void zipios::zipRead (std::istream &is, std::string &str, ssize_t const count)
 
void zipios::zipRead (buffer_t const &is, size_t &pos, uint32_t &value)
 
void zipios::zipRead (buffer_t const &is, size_t &pos, uint16_t &value)
 
void zipios::zipRead (buffer_t const &is, size_t &pos, uint8_t &value)
 
void zipios::zipRead (buffer_t const &is, size_t &pos, buffer_t &buffer, ssize_t const count)
 
void zipios::zipRead (buffer_t const &is, size_t &pos, std::string &str, ssize_t const count)
 
void zipios::zipWrite (std::ostream &os, uint32_t const &value)
 
void zipios::zipWrite (std::ostream &os, uint16_t const &value)
 
void zipios::zipWrite (std::ostream &os, uint8_t const &value)
 
void zipios::zipWrite (std::ostream &os, buffer_t const &buffer)
 
void zipios::zipWrite (std::ostream &os, std::string const &str)
 

Detailed Description

This file defines a small set of functions that do not really have another place to live.

Definition in file zipios_common.hpp.

Macro Definition Documentation

#define ZIPIOS_COMMON_HPP

Definition at line 3 of file zipios_common.hpp.

Function Documentation

template<class Type >
void operator+= ( std::vector< Type > &  v1,
std::vector< Type > const &  v2 
)

This function appends vector v2 to vector v1 using a push_back() of all the elements of v2.

Note that the function fails to append anything is you write something like this:

v1 += v1;

Instead, create a new vector and then add the source twice, something like this:

vector<std::string> temp;
temp += v1;
v1 += temp;
Warning
This template is not put in the namespace because in some situation it may not be visible (particularly in tests/catch_common.cpp, somehow.) If you know of a fix for that then it would be great. (I tried "using zipios;" but it did not work, maybe a specialization?)
Parameters
[in,out]v1The vector which receives a copy of v2.
[in]v2The vector to concatenate at the end of v1.

Definition at line 70 of file zipios_common.hpp.