| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #pragma once |
| |
|
| | |
| |
|
| | #include <cfloat> |
| | #include <cstdint> |
| | #include <memory> |
| | #include <vector> |
| |
|
| | #include "E57Exception.h" |
| |
|
| | namespace e57 |
| | { |
| | using std::int16_t; |
| | using std::int32_t; |
| | using std::int64_t; |
| | using std::int8_t; |
| | using std::uint16_t; |
| | using std::uint32_t; |
| | using std::uint64_t; |
| | using std::uint8_t; |
| |
|
| | |
| | |
| | using ustring = std::string; |
| |
|
| | |
| | enum NodeType |
| | { |
| | TypeStructure = 1, |
| | TypeVector = 2, |
| | TypeCompressedVector = 3, |
| | TypeInteger = 4, |
| | TypeScaledInteger = 5, |
| | TypeFloat = 6, |
| | TypeString = 7, |
| | TypeBlob = 8, |
| |
|
| | |
| | E57_STRUCTURE E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeStructure." ) = |
| | TypeStructure, |
| | |
| | E57_VECTOR E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeVector." ) = TypeVector, |
| | |
| | E57_COMPRESSED_VECTOR E57_DEPRECATED_ENUM( |
| | "Will be removed in 4.0. Use TypeCompressedVector." ) = TypeCompressedVector, |
| | |
| | E57_INTEGER E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeInteger." ) = TypeInteger, |
| | |
| | E57_SCALED_INTEGER E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeScaledInteger." ) = |
| | TypeScaledInteger, |
| | |
| | E57_FLOAT E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeFloat." ) = TypeFloat, |
| | |
| | E57_STRING E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeString." ) = TypeString, |
| | |
| | E57_BLOB E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use TypeBlob." ) = TypeBlob |
| | }; |
| |
|
| | |
| | enum FloatPrecision |
| | { |
| | PrecisionSingle = 1, |
| | PrecisionDouble = 2, |
| |
|
| | |
| | E57_SINGLE E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use PrecisionSingle." ) = |
| | PrecisionSingle, |
| | |
| | E57_DOUBLE E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use PrecisionDouble." ) = |
| | PrecisionDouble |
| | }; |
| |
|
| | |
| | enum MemoryRepresentation |
| | { |
| | Int8 = 1, |
| | UInt8 = 2, |
| | Int16 = 3, |
| | UInt16 = 4, |
| | Int32 = 5, |
| | UInt32 = 6, |
| | Int64 = 7, |
| | Bool = 8, |
| | Real32 = 9, |
| | Real64 = 10, |
| | UString = 11, |
| |
|
| | |
| | E57_INT8 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use Int8." ) = Int8, |
| | |
| | E57_UINT8 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use UInt8." ) = UInt8, |
| | |
| | E57_INT16 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use Int16." ) = Int16, |
| | |
| | E57_UINT16 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use UInt16." ) = UInt16, |
| | |
| | E57_INT32 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use Int32." ) = Int32, |
| | |
| | E57_UINT32 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use UInt32." ) = UInt32, |
| | |
| | E57_INT64 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use Int64." ) = Int64, |
| | |
| | E57_BOOL E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use Bool." ) = Bool, |
| | |
| | E57_REAL32 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use Real32." ) = Real32, |
| | |
| | E57_REAL64 E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use Real64." ) = Real64, |
| | |
| | E57_USTRING E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use UString." ) = UString |
| | }; |
| |
|
| | |
| | |
| | |
| | enum ChecksumPolicy |
| | { |
| | ChecksumNone = 0, |
| | ChecksumSparse = 25, |
| | ChecksumHalf = 50, |
| | ChecksumAll = 100 |
| | }; |
| |
|
| | |
| | |
| | |
| | using ReadChecksumPolicy = int; |
| |
|
| | |
| | |
| | |
| |
|
| | |
| | [[deprecated( |
| | "Will be removed in 4.0. Use ChecksumPolicy::ChecksumNone." )]] |
| | constexpr ReadChecksumPolicy CHECKSUM_POLICY_NONE = ChecksumNone; |
| |
|
| | |
| | [[deprecated( |
| | "Will be removed in 4.0. Use ChecksumPolicy::ChecksumSparse." )]] |
| | constexpr ReadChecksumPolicy CHECKSUM_POLICY_SPARSE = ChecksumSparse; |
| |
|
| | |
| | [[deprecated( |
| | "Will be removed in 4.0. Use ChecksumPolicy::ChecksumHalf." )]] |
| | constexpr ReadChecksumPolicy CHECKSUM_POLICY_HALF = ChecksumHalf; |
| |
|
| | |
| | [[deprecated( |
| | "Will be removed in 4.0. Use ChecksumPolicy::ChecksumAll." )]] |
| | constexpr ReadChecksumPolicy CHECKSUM_POLICY_ALL = ChecksumAll; |
| |
|
| | |
| |
|
| | |
| | |
| | |
| | constexpr char VERSION_1_0_URI[] = "http://www.astm.org/COMMIT/E57/2010-e57-v1.0"; |
| |
|
| | |
| | [[deprecated( "Will be removed in 4.0. Use e57::VERSION_1_0_URI." )]] |
| | constexpr auto E57_V1_0_URI = VERSION_1_0_URI; |
| |
|
| | |
| | |
| | constexpr uint8_t UINT8_MIN = 0U; |
| | constexpr uint16_t UINT16_MIN = 0U; |
| | constexpr uint32_t UINT32_MIN = 0U; |
| | constexpr uint64_t UINT64_MIN = 0ULL; |
| |
|
| | constexpr float FLOAT_MIN = -FLT_MAX; |
| | constexpr float FLOAT_MAX = FLT_MAX; |
| | constexpr double DOUBLE_MIN = -DBL_MAX; |
| | constexpr double DOUBLE_MAX = DBL_MAX; |
| | |
| |
|
| | |
| | |
| | |
| | |
| | #ifdef E57_INTERNAL_IMPLEMENTATION_ENABLE |
| | #define E57_INTERNAL_ACCESS( T ) \ |
| | public: \ |
| | std::shared_ptr<T##Impl> impl() const \ |
| | { \ |
| | return ( impl_ ); \ |
| | } |
| | #else |
| | #define E57_INTERNAL_ACCESS( T ) |
| | #endif |
| | |
| |
|
| | class BlobNode; |
| | class BlobNodeImpl; |
| | class CompressedVectorNode; |
| | class CompressedVectorNodeImpl; |
| | class CompressedVectorReader; |
| | class CompressedVectorReaderImpl; |
| | class CompressedVectorWriter; |
| | class CompressedVectorWriterImpl; |
| | class FloatNode; |
| | class FloatNodeImpl; |
| | class ImageFile; |
| | class ImageFileImpl; |
| | class IntegerNode; |
| | class IntegerNodeImpl; |
| | class Node; |
| | class NodeImpl; |
| | class ScaledIntegerNode; |
| | class ScaledIntegerNodeImpl; |
| | class SourceDestBuffer; |
| | class SourceDestBufferImpl; |
| | class StringNode; |
| | class StringNodeImpl; |
| | class StructureNode; |
| | class StructureNodeImpl; |
| | class VectorNode; |
| | class VectorNodeImpl; |
| |
|
| | class E57_DLL Node |
| | { |
| | public: |
| | Node() = delete; |
| |
|
| | NodeType type() const; |
| | bool isRoot() const; |
| | Node parent() const; |
| | ustring pathName() const; |
| | ustring elementName() const; |
| | ImageFile destImageFile() const; |
| | bool isAttached() const; |
| | void dump( int indent = 0, std::ostream &os = std::cout ) const; |
| | void checkInvariant( bool doRecurse = true, bool doDowncast = true ); |
| | bool operator==( const Node &n2 ) const; |
| | bool operator!=( const Node &n2 ) const; |
| |
|
| | |
| | #ifdef E57_INTERNAL_IMPLEMENTATION_ENABLE |
| | explicit Node( std::shared_ptr<NodeImpl> ); |
| | #endif |
| |
|
| | private: |
| | friend class NodeImpl; |
| |
|
| | E57_INTERNAL_ACCESS( Node ) |
| |
|
| | protected: |
| | std::shared_ptr<NodeImpl> impl_; |
| | |
| | }; |
| |
|
| | class E57_DLL StructureNode |
| | { |
| | public: |
| | StructureNode() = delete; |
| | explicit StructureNode( const ImageFile &destImageFile ); |
| |
|
| | int64_t childCount() const; |
| | bool isDefined( const ustring &pathName ) const; |
| | Node get( int64_t index ) const; |
| | Node get( const ustring &pathName ) const; |
| | void set( const ustring &pathName, const Node &n ); |
| |
|
| | |
| | operator Node() const; |
| | explicit StructureNode( const Node &n ); |
| |
|
| | |
| | bool isRoot() const; |
| | Node parent() const; |
| | ustring pathName() const; |
| | ustring elementName() const; |
| | ImageFile destImageFile() const; |
| | bool isAttached() const; |
| |
|
| | |
| | void dump( int indent = 0, std::ostream &os = std::cout ) const; |
| | void checkInvariant( bool doRecurse = true, bool doUpcast = true ) const; |
| |
|
| | |
| | private: |
| | friend class ImageFile; |
| |
|
| | explicit StructureNode( std::shared_ptr<StructureNodeImpl> ni ); |
| | explicit StructureNode( std::weak_ptr<ImageFileImpl> fileParent ); |
| |
|
| | E57_INTERNAL_ACCESS( StructureNode ) |
| |
|
| | protected: |
| | std::shared_ptr<StructureNodeImpl> impl_; |
| | |
| | }; |
| |
|
| | class E57_DLL VectorNode |
| | { |
| | public: |
| | VectorNode() = delete; |
| | explicit VectorNode( const ImageFile &destImageFile, bool allowHeteroChildren = false ); |
| |
|
| | bool allowHeteroChildren() const; |
| |
|
| | int64_t childCount() const; |
| | bool isDefined( const ustring &pathName ) const; |
| | Node get( int64_t index ) const; |
| | Node get( const ustring &pathName ) const; |
| | void append( const Node &n ); |
| |
|
| | |
| | operator Node() const; |
| | explicit VectorNode( const Node &n ); |
| |
|
| | |
| | bool isRoot() const; |
| | Node parent() const; |
| | ustring pathName() const; |
| | ustring elementName() const; |
| | ImageFile destImageFile() const; |
| | bool isAttached() const; |
| |
|
| | |
| | void dump( int indent = 0, std::ostream &os = std::cout ) const; |
| | void checkInvariant( bool doRecurse = true, bool doUpcast = true ) const; |
| |
|
| | |
| | private: |
| | friend class CompressedVectorNode; |
| |
|
| | explicit VectorNode( std::shared_ptr<VectorNodeImpl> ni ); |
| |
|
| | E57_INTERNAL_ACCESS( VectorNode ) |
| |
|
| | protected: |
| | std::shared_ptr<VectorNodeImpl> impl_; |
| | |
| | }; |
| |
|
| | class E57_DLL SourceDestBuffer |
| | { |
| | public: |
| | SourceDestBuffer() = delete; |
| | SourceDestBuffer( const ImageFile &destImageFile, const ustring &pathName, int8_t *b, |
| | size_t capacity, bool doConversion = false, bool doScaling = false, |
| | size_t stride = sizeof( int8_t ) ); |
| | SourceDestBuffer( const ImageFile &destImageFile, const ustring &pathName, uint8_t *b, |
| | size_t capacity, bool doConversion = false, bool doScaling = false, |
| | size_t stride = sizeof( uint8_t ) ); |
| | SourceDestBuffer( const ImageFile &destImageFile, const ustring &pathName, int16_t *b, |
| | size_t capacity, bool doConversion = false, bool doScaling = false, |
| | size_t stride = sizeof( int16_t ) ); |
| | SourceDestBuffer( const ImageFile &destImageFile, const ustring &pathName, uint16_t *b, |
| | size_t capacity, bool doConversion = false, bool doScaling = false, |
| | size_t stride = sizeof( uint16_t ) ); |
| | SourceDestBuffer( const ImageFile &destImageFile, const ustring &pathName, int32_t *b, |
| | size_t capacity, bool doConversion = false, bool doScaling = false, |
| | size_t stride = sizeof( int32_t ) ); |
| | SourceDestBuffer( const ImageFile &destImageFile, const ustring &pathName, uint32_t *b, |
| | size_t capacity, bool doConversion = false, bool doScaling = false, |
| | size_t stride = sizeof( uint32_t ) ); |
| | SourceDestBuffer( const ImageFile &destImageFile, const ustring &pathName, int64_t *b, |
| | size_t capacity, bool doConversion = false, bool doScaling = false, |
| | size_t stride = sizeof( int64_t ) ); |
| | SourceDestBuffer( const ImageFile &destImageFile, const ustring &pathName, bool *b, |
| | size_t capacity, bool doConversion = false, bool doScaling = false, |
| | size_t stride = sizeof( bool ) ); |
| | SourceDestBuffer( const ImageFile &destImageFile, const ustring &pathName, float *b, |
| | size_t capacity, bool doConversion = false, bool doScaling = false, |
| | size_t stride = sizeof( float ) ); |
| | SourceDestBuffer( const ImageFile &destImageFile, const ustring &pathName, double *b, |
| | size_t capacity, bool doConversion = false, bool doScaling = false, |
| | size_t stride = sizeof( double ) ); |
| | SourceDestBuffer( const ImageFile &destImageFile, const ustring &pathName, |
| | std::vector<ustring> *b ); |
| |
|
| | ustring pathName() const; |
| | enum MemoryRepresentation memoryRepresentation() const; |
| | size_t capacity() const; |
| | bool doConversion() const; |
| | bool doScaling() const; |
| | size_t stride() const; |
| |
|
| | |
| | void dump( int indent = 0, std::ostream &os = std::cout ) const; |
| | void checkInvariant( bool doRecurse = true ) const; |
| |
|
| | |
| | E57_INTERNAL_ACCESS( SourceDestBuffer ) |
| |
|
| | protected: |
| | std::shared_ptr<SourceDestBufferImpl> impl_; |
| | |
| | }; |
| |
|
| | class E57_DLL CompressedVectorReader |
| | { |
| | public: |
| | CompressedVectorReader() = delete; |
| |
|
| | unsigned read(); |
| | unsigned read( std::vector<SourceDestBuffer> &dbufs ); |
| | void seek( int64_t recordNumber ); |
| | void close(); |
| | bool isOpen(); |
| | CompressedVectorNode compressedVectorNode() const; |
| |
|
| | void dump( int indent = 0, std::ostream &os = std::cout ) const; |
| | void checkInvariant( bool doRecurse = true ); |
| |
|
| | |
| | private: |
| | friend class CompressedVectorNode; |
| |
|
| | explicit CompressedVectorReader( std::shared_ptr<CompressedVectorReaderImpl> ni ); |
| |
|
| | E57_INTERNAL_ACCESS( CompressedVectorReader ) |
| |
|
| | protected: |
| | std::shared_ptr<CompressedVectorReaderImpl> impl_; |
| | |
| | }; |
| |
|
| | class E57_DLL CompressedVectorWriter |
| | { |
| | public: |
| | CompressedVectorWriter() = delete; |
| |
|
| | void write( size_t recordCount ); |
| | void write( std::vector<SourceDestBuffer> &sbufs, size_t recordCount ); |
| | void close(); |
| | bool isOpen(); |
| | CompressedVectorNode compressedVectorNode() const; |
| |
|
| | void dump( int indent = 0, std::ostream &os = std::cout ) const; |
| | void checkInvariant( bool doRecurse = true ); |
| |
|
| | |
| | private: |
| | friend class CompressedVectorNode; |
| |
|
| | explicit CompressedVectorWriter( std::shared_ptr<CompressedVectorWriterImpl> ni ); |
| |
|
| | E57_INTERNAL_ACCESS( CompressedVectorWriter ) |
| |
|
| | protected: |
| | std::shared_ptr<CompressedVectorWriterImpl> impl_; |
| | |
| | }; |
| |
|
| | class E57_DLL CompressedVectorNode |
| | { |
| | public: |
| | CompressedVectorNode() = delete; |
| | explicit CompressedVectorNode( const ImageFile &destImageFile, const Node &prototype, |
| | const VectorNode &codecs ); |
| |
|
| | int64_t childCount() const; |
| | Node prototype() const; |
| | VectorNode codecs() const; |
| |
|
| | |
| | CompressedVectorWriter writer( std::vector<SourceDestBuffer> &sbufs ); |
| | CompressedVectorReader reader( const std::vector<SourceDestBuffer> &dbufs ); |
| |
|
| | |
| | operator Node() const; |
| | explicit CompressedVectorNode( const Node &n ); |
| |
|
| | |
| | bool isRoot() const; |
| | Node parent() const; |
| | ustring pathName() const; |
| | ustring elementName() const; |
| | ImageFile destImageFile() const; |
| | bool isAttached() const; |
| |
|
| | |
| | void dump( int indent = 0, std::ostream &os = std::cout ) const; |
| | void checkInvariant( bool doRecurse = true, bool doUpcast = true ) const; |
| |
|
| | |
| | private: |
| | friend class CompressedVectorReader; |
| | friend class CompressedVectorWriter; |
| | friend class E57XmlParser; |
| |
|
| | CompressedVectorNode( std::shared_ptr<CompressedVectorNodeImpl> ni ); |
| |
|
| | E57_INTERNAL_ACCESS( CompressedVectorNode ) |
| |
|
| | protected: |
| | std::shared_ptr<CompressedVectorNodeImpl> impl_; |
| | |
| | }; |
| |
|
| | class E57_DLL IntegerNode |
| | { |
| | public: |
| | IntegerNode() = delete; |
| | explicit IntegerNode( const ImageFile &destImageFile, int64_t value = 0, |
| | int64_t minimum = INT64_MIN, int64_t maximum = INT64_MAX ); |
| |
|
| | int64_t value() const; |
| | int64_t minimum() const; |
| | int64_t maximum() const; |
| |
|
| | |
| | operator Node() const; |
| | explicit IntegerNode( const Node &n ); |
| |
|
| | |
| | bool isRoot() const; |
| | Node parent() const; |
| | ustring pathName() const; |
| | ustring elementName() const; |
| | ImageFile destImageFile() const; |
| | bool isAttached() const; |
| |
|
| | |
| | void dump( int indent = 0, std::ostream &os = std::cout ) const; |
| | void checkInvariant( bool doRecurse = true, bool doUpcast = true ) const; |
| |
|
| | |
| | private: |
| | explicit IntegerNode( std::shared_ptr<IntegerNodeImpl> ni ); |
| |
|
| | E57_INTERNAL_ACCESS( IntegerNode ) |
| |
|
| | protected: |
| | std::shared_ptr<IntegerNodeImpl> impl_; |
| | |
| | }; |
| |
|
| | class E57_DLL ScaledIntegerNode |
| | { |
| | public: |
| | ScaledIntegerNode() = delete; |
| | explicit ScaledIntegerNode( const ImageFile &destImageFile, int64_t rawValue, int64_t minimum, |
| | int64_t maximum, double scale = 1.0, double offset = 0.0 ); |
| | explicit ScaledIntegerNode( const ImageFile &destImageFile, int rawValue, int64_t minimum, |
| | int64_t maximum, double scale = 1.0, double offset = 0.0 ); |
| | explicit ScaledIntegerNode( const ImageFile &destImageFile, int rawValue, int minimum, |
| | int maximum, double scale = 1.0, double offset = 0.0 ); |
| | explicit ScaledIntegerNode( const ImageFile &destImageFile, double scaledValue, |
| | double scaledMinimum, double scaledMaximum, double scale = 1.0, |
| | double offset = 0.0 ); |
| |
|
| | int64_t rawValue() const; |
| | double scaledValue() const; |
| | int64_t minimum() const; |
| | double scaledMinimum() const; |
| | int64_t maximum() const; |
| | double scaledMaximum() const; |
| | double scale() const; |
| | double offset() const; |
| |
|
| | |
| | operator Node() const; |
| | explicit ScaledIntegerNode( const Node &n ); |
| |
|
| | |
| | bool isRoot() const; |
| | Node parent() const; |
| | ustring pathName() const; |
| | ustring elementName() const; |
| | ImageFile destImageFile() const; |
| | bool isAttached() const; |
| |
|
| | |
| | void dump( int indent = 0, std::ostream &os = std::cout ) const; |
| | void checkInvariant( bool doRecurse = true, bool doUpcast = true ) const; |
| |
|
| | |
| | private: |
| | explicit ScaledIntegerNode( std::shared_ptr<ScaledIntegerNodeImpl> ni ); |
| |
|
| | E57_INTERNAL_ACCESS( ScaledIntegerNode ) |
| |
|
| | protected: |
| | std::shared_ptr<ScaledIntegerNodeImpl> impl_; |
| | |
| | }; |
| |
|
| | class E57_DLL FloatNode |
| | { |
| | public: |
| | FloatNode() = delete; |
| | explicit FloatNode( const ImageFile &destImageFile, double value = 0.0, |
| | FloatPrecision precision = PrecisionDouble, double minimum = DOUBLE_MIN, |
| | double maximum = DOUBLE_MAX ); |
| |
|
| | double value() const; |
| | FloatPrecision precision() const; |
| | double minimum() const; |
| | double maximum() const; |
| |
|
| | |
| | operator Node() const; |
| | explicit FloatNode( const Node &n ); |
| |
|
| | |
| | bool isRoot() const; |
| | Node parent() const; |
| | ustring pathName() const; |
| | ustring elementName() const; |
| | ImageFile destImageFile() const; |
| | bool isAttached() const; |
| |
|
| | |
| | void dump( int indent = 0, std::ostream &os = std::cout ) const; |
| | void checkInvariant( bool doRecurse = true, bool doUpcast = true ) const; |
| |
|
| | |
| | private: |
| | explicit FloatNode( std::shared_ptr<FloatNodeImpl> ni ); |
| |
|
| | E57_INTERNAL_ACCESS( FloatNode ) |
| |
|
| | protected: |
| | std::shared_ptr<FloatNodeImpl> impl_; |
| | |
| | }; |
| |
|
| | class E57_DLL StringNode |
| | { |
| | public: |
| | StringNode() = delete; |
| | explicit StringNode( const ImageFile &destImageFile, const ustring &value = "" ); |
| |
|
| | ustring value() const; |
| |
|
| | |
| | operator Node() const; |
| | explicit StringNode( const Node &n ); |
| |
|
| | |
| | bool isRoot() const; |
| | Node parent() const; |
| | ustring pathName() const; |
| | ustring elementName() const; |
| | ImageFile destImageFile() const; |
| | bool isAttached() const; |
| |
|
| | |
| | void dump( int indent = 0, std::ostream &os = std::cout ) const; |
| | void checkInvariant( bool doRecurse = true, bool doUpcast = true ) const; |
| |
|
| | |
| | private: |
| | friend class StringNodeImpl; |
| |
|
| | explicit StringNode( std::shared_ptr<StringNodeImpl> ni ); |
| |
|
| | E57_INTERNAL_ACCESS( StringNode ) |
| |
|
| | protected: |
| | std::shared_ptr<StringNodeImpl> impl_; |
| | |
| | }; |
| |
|
| | class E57_DLL BlobNode |
| | { |
| | public: |
| | BlobNode() = delete; |
| | explicit BlobNode( const ImageFile &destImageFile, int64_t byteCount ); |
| |
|
| | int64_t byteCount() const; |
| | void read( uint8_t *buf, int64_t start, size_t count ); |
| | void write( uint8_t *buf, int64_t start, size_t count ); |
| |
|
| | |
| | operator Node() const; |
| | explicit BlobNode( const Node &n ); |
| |
|
| | |
| | bool isRoot() const; |
| | Node parent() const; |
| | ustring pathName() const; |
| | ustring elementName() const; |
| | ImageFile destImageFile() const; |
| | bool isAttached() const; |
| |
|
| | |
| | void dump( int indent = 0, std::ostream &os = std::cout ) const; |
| | void checkInvariant( bool doRecurse = true, bool doUpcast = true ) const; |
| |
|
| | |
| | private: |
| | friend class E57XmlParser; |
| |
|
| | explicit BlobNode( std::shared_ptr<BlobNodeImpl> ni ); |
| |
|
| | |
| | BlobNode( const ImageFile &destImageFile, int64_t fileOffset, int64_t length ); |
| |
|
| | E57_INTERNAL_ACCESS( BlobNode ) |
| |
|
| | protected: |
| | std::shared_ptr<BlobNodeImpl> impl_; |
| | |
| | }; |
| |
|
| | class E57_DLL ImageFile |
| | { |
| | public: |
| | ImageFile() = delete; |
| | ImageFile( const ustring &fname, const ustring &mode, |
| | ReadChecksumPolicy checksumPolicy = ChecksumAll ); |
| | ImageFile( const char *input, uint64_t size, |
| | ReadChecksumPolicy checksumPolicy = ChecksumAll ); |
| |
|
| | StructureNode root() const; |
| | void close(); |
| | void cancel(); |
| | bool isOpen() const; |
| | bool isWritable() const; |
| | ustring fileName() const; |
| | int writerCount() const; |
| | int readerCount() const; |
| |
|
| | |
| | void extensionsAdd( const ustring &prefix, const ustring &uri ); |
| | bool extensionsLookupPrefix( const ustring &prefix ) const; |
| | bool extensionsLookupPrefix( const ustring &prefix, ustring &uri ) const; |
| | bool extensionsLookupUri( const ustring &uri, ustring &prefix ) const; |
| | size_t extensionsCount() const; |
| | ustring extensionsPrefix( size_t index ) const; |
| | ustring extensionsUri( size_t index ) const; |
| |
|
| | |
| | bool isElementNameExtended( const ustring &elementName ) const; |
| | void elementNameParse( const ustring &elementName, ustring &prefix, |
| | ustring &localPart ) const; |
| |
|
| | |
| | void dump( int indent = 0, std::ostream &os = std::cout ) const; |
| | void checkInvariant( bool doRecurse = true ) const; |
| | bool operator==( const ImageFile &imf2 ) const; |
| | bool operator!=( const ImageFile &imf2 ) const; |
| |
|
| | |
| | private: |
| | explicit ImageFile( double ); |
| |
|
| | friend class Node; |
| | friend class StructureNode; |
| | friend class VectorNode; |
| | friend class CompressedVectorNode; |
| | friend class IntegerNode; |
| | friend class ScaledIntegerNode; |
| | friend class FloatNode; |
| | friend class StringNode; |
| | friend class BlobNode; |
| |
|
| | explicit ImageFile( std::shared_ptr<ImageFileImpl> imfi ); |
| |
|
| | E57_INTERNAL_ACCESS( ImageFile ) |
| |
|
| | protected: |
| | std::shared_ptr<ImageFileImpl> impl_; |
| | |
| | }; |
| | } |
| |
|