libetonyek_utils.h File Reference documentation

libetonyek_utils.h File Reference
`#include <cmath>`
`#include <memory>`
`#include <string>`
`#include <boost/cstdint.hpp>`
`#include <librevenge/librevenge.h>`
`#include <librevenge-stream/librevenge-stream.h>`

Go to the source code of this file.

## Classes
struct | libetonyek::EtonyekDummyDeleter
class | libetonyek::EndOfStreamException
class | libetonyek::GenericException

## Namespaces
namespace | libetonyek

## Macros
#define | ETONYEK_EPSILON 1e-9
#define | ETONYEK_ALMOST_ZERO(x)
#define | ETONYEK_NUM_ELEMENTS(array)
#define | ETONYEK_ATTRIBUTE_PRINTF(fmt, arg)
#define | ETONYEK_FALLTHROUGH ((void) 0)
#define | ETONYEK_DEBUG_MSG(M)
#define | ETONYEK_DEBUG(M)

## Typedefs
typedef std::shared_ptr< librevenge::RVNGInputStream > | libetonyek::RVNGInputStreamPtr_t

## Functions
const double | libetonyek::etonyek_half_pi (1.57079632679489661923132169163975144209858469968755291048747229615390820314310449931401741267105853399107404326e+00)
const double | libetonyek::etonyek_third_pi (1.04719755119659774615421446109316762806572313312503527365831486410260546876206966620934494178070568932738269550e+00)
const double | libetonyek::etonyek_pi (3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651e+00)
const double | libetonyek::etonyek_two_pi (6.28318530717958647692528676655900576839433879875021164194988918461563281257241799725606965068423413596429617303e+00)
const double | libetonyek::etonyek_root_three (1.73205080756887729352744634150587236694280525381038062805580697945193301690880003708114618675724857567562614142e+00)
const double | libetonyek::etonyek_root_two (1.41421356237309504880168872420969807856967187537694807317667973799073247846210703885038753432764157273501384623e+00)
const unsigned | libetonyek::ETONYEK_EPOCH_BEGIN (978307200)
uint8_t | libetonyek::readU8 (const RVNGInputStreamPtr_t &input, bool)
uint16_t | libetonyek::readU16 (const RVNGInputStreamPtr_t &input, bool bigEndian)
uint32_t | libetonyek::readU32 (const RVNGInputStreamPtr_t &input, bool bigEndian)
uint64_t | libetonyek::readU64 (const RVNGInputStreamPtr_t &input, bool bigEndian)
uint64_t | libetonyek::readUVar (const RVNGInputStreamPtr_t &input)
int64_t | libetonyek::readSVar (const RVNGInputStreamPtr_t &input)
double | libetonyek::readDouble (const RVNGInputStreamPtr_t &input)
float | libetonyek::readFloat (const RVNGInputStreamPtr_t &input)
unsigned long | libetonyek::getLength (const RVNGInputStreamPtr_t &input)
unsigned long | libetonyek::getRemainingLength (const RVNGInputStreamPtr_t &input)
bool | libetonyek::approxEqual (double x, double y, double eps=ETONYEK_EPSILON)
| Test two floating point numbers for equality.
template<class T>
bool | libetonyek::approxEqual (const T &left, const T &right, const double eps=ETONYEK_EPSILON)
double | libetonyek::pt2in (double d)
| Convert a length from points to inches.
double | libetonyek::deg2rad (double value)
| Convert an angle from degrees to radians.
double | libetonyek::rad2deg (double value)
| Convert an angle from radians to degrees.
librevenge::RVNGString | libetonyek::makeColor (const IWORKColor &color)
librevenge::RVNGString | libetonyek::makeColor (const IWORKGradient &gradient)
| Compute the average color of a gradient and return it as a string.
void | libetonyek::writeBorder (const IWORKStroke &stroke, const char *const name, librevenge::RVNGPropertyList &props)
std::string | libetonyek::detectMimetype (const RVNGInputStreamPtr_t &stream)
bool | libetonyek::detectImageDimension (const RVNGInputStreamPtr_t &stream, double &width, double &height)

## Macro Definition Documentation

## ◆ ETONYEK_ALMOST_ZERO

#define ETONYEK_ALMOST_ZERO | ( |  | x | ) |

Value:
(std::fabs(x) < ETONYEK_EPSILON)
ETONYEK_EPSILON
#define ETONYEK_EPSILON
Definition libetonyek_utils.h:26

## ◆ ETONYEK_ATTRIBUTE_PRINTF

#define ETONYEK_ATTRIBUTE_PRINTF | ( |  | fmt,
|  |  | arg )

## ◆ ETONYEK_DEBUG

#define ETONYEK_DEBUG | ( |  | M | ) |

## ◆ ETONYEK_DEBUG_MSG

#define ETONYEK_DEBUG_MSG | ( |  | M | ) |

Referenced by libetonyek::IWORKOutputElements::addShapesInSpreadsheet(), libetonyek::IWORKBezierElement::attribute(), libetonyek::IWORKColorElement::attribute(), libetonyek::IWORKDataElement::attribute(), libetonyek::IWORKDateTimeFormatElement::attribute(), libetonyek::IWORKDurationFormatElement::attribute(), libetonyek::IWORKExternalTextWrapElement::attribute(), libetonyek::IWORKLayoutElement::attribute(), libetonyek::IWORKLineEndElement::attribute(), libetonyek::IWORKListLabelTypeinfoElement::attribute(), libetonyek::IWORKNumberElement< T >::attribute(), libetonyek::IWORKNumberFormatElement::attribute(), libetonyek::IWORKPElement::attribute(), libetonyek::IWORKPositionElement::attribute(), libetonyek::IWORKShapeContext::attribute(), libetonyek::IWORKSizeElement::attribute(), libetonyek::IWORKSpanElement::attribute(), libetonyek::IWORKStyleContext::attribute(), libetonyek::IWORKTextElement::attribute(), libetonyek::IWORKTextLabelElement::attribute(), libetonyek::IWORKWrapElement::attribute(), libetonyek::KEY1ContentElement::attribute(), libetonyek::KEY1DivElement::attribute(), libetonyek::KEY1FillElement::attribute(), libetonyek::KEY1SpanElement::attribute(), libetonyek::KEY1TableElement::attribute(), libetonyek::IWORKXMLContext::CDATA(), libetonyek::KEY1ParserState::closeBullet(), libetonyek::KEY1ParserState::closeBullets(), libetonyek::KEY2ParserState::closeBullets(), libetonyek::KEY2ParserState::closeHeadline(), libetonyek::IWORKText::closeLink(), libetonyek::PAGCollector::closePageGroup(), libetonyek::PAGCollector::collectAnnotation(), libetonyek::IWORKCollector::collectHeaderFooter(), libetonyek::IWORKCollector::collectShape(), libetonyek::IWORKCollector::collectStickyNote(), libetonyek::KEY1Dictionary::collectStylesContext(), libetonyek::KEY1StringConverter< T >::convert(), libetonyek::detectMimetype(), libetonyek::IWAParser::dispatchShapeWithMessage(), libetonyek::IWORKTable::draw(), libetonyek::IWORKCollector::drawLine(), libetonyek::NUMCollector::drawMedia(), libetonyek::PAGCollector::drawMedia(), libetonyek::IWORKCollector::drawShape(), libetonyek::IWORKCalcEngineContext::element(), libetonyek::IWORKCellCommentDrawableInfoElement::element(), libetonyek::IWORKColorElement::element(), libetonyek::IWORKContainerContext< Type, NestedParser, Collector, Id, RefId >::element(), libetonyek::IWORKExternalTextWrapElement::element(), libetonyek::IWORKFillElement::element(), libetonyek::IWORKFilteredImageElement::element(), libetonyek::IWORKFoElement::element(), libetonyek::IWORKFormulaElement::element(), libetonyek::IWORKGeometryElement::element(), libetonyek::IWORKImageContext::element(), libetonyek::IWORKImageElement::element(), libetonyek::IWORKLineElement::element(), libetonyek::IWORKLineEndElement::element(), libetonyek::IWORKLinkElement::element(), libetonyek::IWORKListLabelGeometriesProperty::element(), libetonyek::IWORKListLabelIndentsProperty::element(), libetonyek::IWORKListLabelTypeinfoElement::element(), libetonyek::IWORKListLabelTypesProperty::element(), libetonyek::IWORKListTextIndentsProperty::element(), libetonyek::IWORKMediaElement::element(), libetonyek::IWORKMetadataElement::element(), libetonyek::IWORKOfElement::element(), libetonyek::IWORKPathElement::element(), libetonyek::IWORKPElement::element(), libetonyek::IWORKPropertyContext< Property, Context, TokenId, TokenId2 >::element(), libetonyek::IWORKPropertyMapElement::element(), libetonyek::IWORKShapeContext::element(), libetonyek::IWORKSpanElement::element(), libetonyek::IWORKStrokeContext::element(), libetonyek::IWORKStyleContainer< TokenId, RefTokenId, TokenId2, RefTokenId2 >::element(), libetonyek::IWORKStyleContext::element(), libetonyek::IWORKStylesContext::element(), libetonyek::IWORKStylesheetBase::element(), libetonyek::IWORKTableCellFormulaElement::element(), libetonyek::IWORKTableInfoElement::element(), libetonyek::IWORKTabularInfoElement::element(), libetonyek::IWORKTabularModelElement::element(), libetonyek::IWORKTextBodyElement::element(), libetonyek::IWORKTextElement::element(), libetonyek::IWORKTextStorageElement::element(), libetonyek::IWORKValueContext< double, IWORKNumberElement< double >, IWORKToken::NS_URI_SF|IWORKToken::number >::element(), libetonyek::IWORKWrapElement::element(), libetonyek::IWORKXMLContextEmpty::element(), libetonyek::IWORKXMLContextText::element(), libetonyek::KEY1ContentElement::element(), libetonyek::KEY1DivElement::element(), libetonyek::KEY1FillElement::element(), libetonyek::KEY1SpanElement::element(), libetonyek::KEY1StylesContext::element(), libetonyek::KEY1TableElement::element(), libetonyek::KEY2StyleContext::element(), libetonyek::PAG1StyleContext::element(), libetonyek::IWORKCellCommentDrawableInfoElement::endOfElement(), libetonyek::IWORKColorElement::endOfElement(), libetonyek::IWORKFillElement::endOfElement(), libetonyek::IWORKFilteredImageElement::endOfElement(), libetonyek::IWORKImageElement::endOfElement(), libetonyek::IWORKListLabelGeometriesProperty::endOfElement(), libetonyek::IWORKListLabelIndentsProperty::endOfElement(), libetonyek::IWORKListLabelTypeinfoElement::endOfElement(), libetonyek::IWORKListLabelTypesProperty::endOfElement(), libetonyek::IWORKListTextIndentsProperty::endOfElement(), libetonyek::IWORKMediaElement::endOfElement(), libetonyek::IWORKOfElement::endOfElement(), libetonyek::IWORKStrokeContext::endOfElement(), libetonyek::IWORKTabularInfoElement::endOfElement(), libetonyek::IWORKTabularModelElement::endOfElement(), libetonyek::IWORKTextElement::endOfElement(), libetonyek::IWORKTextLabelElement::endOfElement(), libetonyek::KEY1FillElement::endOfElement(), libetonyek::KEY1TableElement::endOfElement(), libetonyek::PAG1AnnotationContext::endOfElement(), libetonyek::PAG1AnnotationElement::endOfElement(), libetonyek::NUMCollector::endWorkSpace(), libetonyek::IWORKCollector::fillGraphicProps(), libetonyek::IWORKCollector::fillLayoutProps(), libetonyek::IWORKCollector::fillWrapProps(), libetonyek::IWORKStylesheet::find(), libetonyek::PAGCollector::flushPageSpan(), libetonyek::IWORKXMLParserState::getStyleByName(), libetonyek::IWORKContainerContext< Type, NestedParser, Collector, Id, RefId >::handleRef(), libetonyek::IWORKText::insertField(), libetonyek::KEYCollector::insertLayer(), libetonyek::KEYCollector::insertSlide(), libetonyek::KEYCollector::insertTextPlaceholder(), libetonyek::IWORKStyle::link(), libetonyek::KEY1Dictionary::linkStylesContext(), libetonyek::makeCalloutPath(), libetonyek::makeColor(), libetonyek::IWAParser::ObjectMessage::ObjectMessage(), libetonyek::KEY1ParserState::openBullet(), libetonyek::KEY1ParserState::openBullets(), libetonyek::KEY2ParserState::openBullets(), libetonyek::KEY2ParserState::openHeadline(), libetonyek::PAGCollector::openSection(), libetonyek::IWORKFormula::Token::operator<<, libetonyek::PAG1TextStorageElement::PAG1TextStorageElement(), libetonyek::PAG1TextStorageElement::PAG1TextStorageElement(), libetonyek::IWAMessage::parse(), libetonyek::IWAObjectIndex::parse(), libetonyek::IWAText::parse(), libetonyek::IWAParser::parseAttachment(), libetonyek::IWAParser::parseCellStyle(), libetonyek::IWAParser::parseComment(), libetonyek::IWAParser::parseConditionRules(), libetonyek::IWAParser::parseCustomFormat(), libetonyek::IWAParser::parseDataList(), libetonyek::PAG5Parser::parseDocumentSettingsRef(), libetonyek::IWAParser::parseDrawableShape(), libetonyek::IWAParser::parseFormat(), libetonyek::IWAParser::parseFormula(), libetonyek::IWAParser::parseGraphicStyle(), libetonyek::PAG5Parser::parseGroupRef(), libetonyek::IWAParser::parseListStyle(), libetonyek::IWAParser::parseParagraphStyle(), libetonyek::IWAParser::parsePath(), libetonyek::KEY6Parser::parsePlaceholder(), libetonyek::IWAParser::parseShapePlacement(), libetonyek::IWAParser::parseStickyNote(), libetonyek::IWAParser::parseTableGridLine(), libetonyek::IWAParser::parseTableGridLines(), libetonyek::IWAParser::parseTableHeaders(), libetonyek::IWAParser::parseTabularModel(), libetonyek::IWAParser::parseText(), libetonyek::IWAParser::parseTile(), libetonyek::IWAParser::parseTileDefinition(), libetonyek::KEY1ParserState::popIsMasterSlide(), libetonyek::KEY1ParserState::popIsPrototype(), libetonyek::KEY1Dictionary::popStylesContext(), libetonyek::IWAObjectIndex::queryFile(), libetonyek::IWAObjectIndex::queryFileColor(), libetonyek::IWAObjectIndex::queryObject(), libetonyek::KEY1DivStyle::readAttribute(), libetonyek::KEY1SpanStyle::readAttribute(), libetonyek::IWAParser::readFill(), libetonyek::IWAParser::readGradient(), libetonyek::IWAParser::readStroke(), libetonyek::IWAParser::readUID(), libetonyek::IWAParser::readUUID(), libetonyek::IWAObjectIndex::scanColorFileCorrespondance(), libetonyek::IWAObjectIndex::scanColorFileMap(), libetonyek::IWAObjectIndex::scanFragment(), libetonyek::PAGCollector::sendAnnotation(), libetonyek::IWORKTextStorageElement::sendStylesheet(), libetonyek::NUMCollector::startWorkSpace(), libetonyek::KEY1ParserState::storeCurrentPlaceholder(), libetonyek::IWORKXMLContextElement::text(), libetonyek::IWORKXMLContextEmpty::text(), libetonyek::IWAParser::updateGeometryUsingTextRef(), libetonyek::IWORKTable::writeFormat(), and libetonyek::IWORKLanguageManager::writeProperties().

## ◆ ETONYEK_EPSILON

#define ETONYEK_EPSILON 1e-9

Referenced by libetonyek::approxEqual(), and libetonyek::approxEqual().

## ◆ ETONYEK_FALLTHROUGH

#define ETONYEK_FALLTHROUGH ((void) 0)

Referenced by libetonyek::PAG5Parser::parseDocumentSettingsRef(), libetonyek::IWAParser::parseListStyle(), libetonyek::IWAParser::parsePath(), libetonyek::IWAParser::readFill(), libetonyek::IWAParser::readGradient(), and libetonyek::IWAParser::readStroke().

## ◆ ETONYEK_NUM_ELEMENTS

#define ETONYEK_NUM_ELEMENTS | ( |  | array | ) |

Value:
(sizeof(array) / sizeof((array)[0]))

Referenced by libetonyek::detectImageDimension(), libetonyek::detectMimetype(), libetonyek::IWAParser::parseGraphicStyle(), libetonyek::IWORKTable::setDefaultCellStyle(), libetonyek::IWORKTable::setDefaultLayoutStyle(), and libetonyek::IWORKTable::setDefaultParagraphStyle().