OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
Loading...
Searching...
No Matches
de.hpp File Reference

C++ veneer for unified data exchange. More...

#include <occtl/occtl_de.h>
#include <occtl-hpp/core.hpp>
#include <occtl-hpp/topo.hpp>
#include <cstddef>
#include <cstdint>
#include <optional>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for de.hpp:

Go to the source code of this file.

Classes

struct  occtl::de::FormatInfo
 

Functions

std::pair< Graph, NodeIdocctl::de::read (const std::string &thePath)
 Reads a file dispatched by extension and returns (graph, root).
 
std::pair< Graph, NodeIdocctl::de::read_memory (const std::string &theFormatId, const uint8_t *const theData, const std::size_t theSize)
 Reads a memory payload using an explicit format id and returns (graph, root).
 
std::pair< Graph, NodeIdocctl::de::read_memory (const std::string &theFormatId, const std::vector< uint8_t > &theData)
 Reads a memory payload using an explicit format id and returns (graph, root).
 
void occtl::de::write (const Graph &theGraph, const NodeId theRoot, const std::string &thePath)
 Writes a graph root to a file dispatched by extension.
 
std::vector< uint8_t > occtl::de::write_memory (const Graph &theGraph, const NodeId theRoot, const std::string &theFormatId)
 Writes a graph root into a memory payload using an explicit format id.
 
std::vector< std::string > occtl::de::supported_formats ()
 Returns the stable lowercase format ids the build supports.
 
std::vector< FormatInfoocctl::de::format_infos ()
 Returns rich descriptors for every supported data-exchange format.
 
FormatInfo occtl::de::format_info (const std::string &theFormatId)
 Returns a descriptor for one supported data-exchange format.
 
std::optional< std::string > occtl::de::format_id_for_path (const std::string &thePath)
 Returns the format id for thePath, or std::nullopt if no extension matches.
 

Detailed Description

C++ veneer for unified data exchange.

Function Documentation

◆ read()

std::pair< Graph, NodeId > occtl::de::read ( const std::string &  thePath)
inline

Reads a file dispatched by extension and returns (graph, root).

Exceptions
Erroron failure.

◆ read_memory() [1/2]

std::pair< Graph, NodeId > occtl::de::read_memory ( const std::string &  theFormatId,
const std::vector< uint8_t > &  theData 
)
inline

Reads a memory payload using an explicit format id and returns (graph, root).

Exceptions
Erroron failure.

◆ read_memory() [2/2]

std::pair< Graph, NodeId > occtl::de::read_memory ( const std::string &  theFormatId,
const uint8_t *const  theData,
const std::size_t  theSize 
)
inline

Reads a memory payload using an explicit format id and returns (graph, root).

Exceptions
Erroron failure.

◆ write_memory()

std::vector< uint8_t > occtl::de::write_memory ( const Graph theGraph,
const NodeId  theRoot,
const std::string &  theFormatId 
)
inline

Writes a graph root into a memory payload using an explicit format id.

Exceptions
Erroron failure.