CommonParser.h
Go to the documentation of this file.
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* This file is part of the libcdr project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef __COMMONPARSER_H__
#define __COMMONPARSER_H__
#include <utility>
#include <vector>
#include <librevenge-stream/librevenge-stream.h>
namespace libcdr
{
class CDRCollector;
class CDRPath;
enum CoordinatePrecision
{ PRECISION_UNKNOWN = 0, PRECISION_16BIT, PRECISION_32BIT };
class CommonParser
{
public:
CommonParser(CDRCollector *collector);
virtual ~CommonParser();
private:
CommonParser();
CommonParser(const CommonParser &);
CommonParser &operator=(const CommonParser &);
protected:
double readCoordinate(librevenge::RVNGInputStream *input, bool bigEndian = false);
unsigned readUnsigned(librevenge::RVNGInputStream *input, bool bigEndian = false);
unsigned short readUnsignedShort(librevenge::RVNGInputStream *input, bool bigEndian = false);
int readInteger(librevenge::RVNGInputStream *input, bool bigEndian = false);
double readAngle(librevenge::RVNGInputStream *input, bool bigEndian = false);
void readRImage(unsigned &colorModel, unsigned &width, unsigned &height, unsigned &bpp,
std::vector<unsigned> &palette, std::vector<unsigned char> &bitmap,
librevenge::RVNGInputStream *input, bool bigEndian = false);
void readBmpPattern(unsigned &width, unsigned &height, std::vector<unsigned char> &pattern,
unsigned length, librevenge::RVNGInputStream *input, bool bigEndian = false);
void processPath(const std::vector<std::pair<double, double> > &points, const std::vector<unsigned char> &types, CDRPath &path);
void outputPath(const std::vector<std::pair<double, double> > &points, const std::vector<unsigned char> &types);
CDRCollector *m_collector;
CoordinatePrecision m_precision;
};
} // namespace libcdr
#endif // __COMMONPARSER_H__
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libcdr::CDRCollector
Definition CDRCollector.h:62
libcdr::CDRPath
Definition CDRPath.h:37
libcdr::CommonParser::CommonParser
CommonParser()
libcdr::CommonParser::readCoordinate
double readCoordinate(librevenge::RVNGInputStream *input, bool bigEndian=false)
Definition CommonParser.cpp:25
libcdr::CommonParser::m_precision
CoordinatePrecision m_precision
Definition CommonParser.h:55
libcdr::CommonParser::readAngle
double readAngle(librevenge::RVNGInputStream *input, bool bigEndian=false)
Definition CommonParser.cpp:61
libcdr::CommonParser::readInteger
int readInteger(librevenge::RVNGInputStream *input, bool bigEndian=false)
Definition CommonParser.cpp:52
libcdr::CommonParser::~CommonParser
virtual ~CommonParser()
Definition CommonParser.cpp:21
libcdr::CommonParser::CommonParser
CommonParser(CDRCollector *collector)
Definition CommonParser.cpp:18
libcdr::CommonParser::readRImage
void readRImage(unsigned &colorModel, unsigned &width, unsigned &height, unsigned &bpp, std::vector< unsigned > &palette, std::vector< unsigned char > &bitmap, librevenge::RVNGInputStream *input, bool bigEndian=false)
Definition CommonParser.cpp:135
libcdr::CommonParser::m_collector
CDRCollector * m_collector
Definition CommonParser.h:54
libcdr::CommonParser::readBmpPattern
void readBmpPattern(unsigned &width, unsigned &height, std::vector< unsigned char > &pattern, unsigned length, librevenge::RVNGInputStream *input, bool bigEndian=false)
Definition CommonParser.cpp:175
libcdr::CommonParser::CommonParser
CommonParser(const CommonParser &)
libcdr::CommonParser::readUnsigned
unsigned readUnsigned(librevenge::RVNGInputStream *input, bool bigEndian=false)
Definition CommonParser.cpp:34
libcdr::CommonParser::readUnsignedShort
unsigned short readUnsignedShort(librevenge::RVNGInputStream *input, bool bigEndian=false)
Definition CommonParser.cpp:43
libcdr::CommonParser::outputPath
void outputPath(const std::vector< std::pair< double, double > > &points, const std::vector< unsigned char > &types)
Definition CommonParser.cpp:70
libcdr::CommonParser::operator=
CommonParser & operator=(const CommonParser &)
libcdr::CommonParser::processPath
void processPath(const std::vector< std::pair< double, double > > &points, const std::vector< unsigned char > &types, CDRPath &path)
Definition CommonParser.cpp:78
libcdr
Definition CDRCollector.h:25
libcdr::CoordinatePrecision
CoordinatePrecision
Definition CommonParser.h:25
libcdr::PRECISION_32BIT
@ PRECISION_32BIT
Definition CommonParser.h:25
libcdr::PRECISION_16BIT
@ PRECISION_16BIT
Definition CommonParser.h:25
libcdr::PRECISION_UNKNOWN
@ PRECISION_UNKNOWN
Definition CommonParser.h:25