c2pa-c
C++ API for c2pa-c library
Loading...
Searching...
No Matches
c2pa_internal.hpp File Reference

Internal implementation details shared across c2pa_cpp source files. More...

#include <cstring>
#include <fstream>
#include <filesystem>
#include <string>
#include <vector>
#include <memory>
#include "c2pa.h"
#include "c2pa.hpp"
Include dependency graph for c2pa_internal.hpp:

Go to the source code of this file.

Classes

struct  c2pa::detail::StreamSeekTraits< std::istream >
 
struct  c2pa::detail::StreamSeekTraits< std::ostream >
 
struct  c2pa::detail::StreamSeekTraits< std::iostream >
 

Namespaces

namespace  c2pa
 
namespace  c2pa::detail
 

Functions

std::vector< std::string > c2pa::detail::c_mime_types_to_vector (const char *const *mime_types, uintptr_t count)
 Converts a C array of C strings to a std::vector of std::string.
 
constexpr std::ios_base::seekdir c2pa::detail::whence_to_seekdir (C2paSeekMode whence) noexcept
 Maps C2PA seek mode to std::ios seek direction.
 
template<typename Stream >
bool c2pa::detail::is_stream_usable (Stream *s) noexcept
 Check if stream is in valid state for I/O operations.
 
template<typename Stream >
intptr_t c2pa::detail::stream_seeker (StreamContext *context, intptr_t offset, C2paSeekMode whence)
 Seeker impl.
 
template<typename Stream >
intptr_t c2pa::detail::stream_reader (StreamContext *context, uint8_t *buffer, intptr_t size)
 Reader impl.
 
template<typename Stream , typename Op >
intptr_t c2pa::detail::stream_op (StreamContext *context, Op op)
 Get stream from context, used by writer and flusher.
 
template<typename Stream >
intptr_t c2pa::detail::stream_writer (StreamContext *context, const uint8_t *buffer, intptr_t size)
 Writer impl.
 
template<typename Stream >
intptr_t c2pa::detail::stream_flusher (StreamContext *context)
 Flusher impl.
 
template<typename StreamType >
std::unique_ptr< StreamTypec2pa::detail::open_file_binary (const std::filesystem::path &path)
 Open a binary file stream with error handling.
 
std::string c2pa::detail::extract_file_extension (const std::filesystem::path &path) noexcept
 Extract file extension without the leading dot.
 
template<typename T >
std::string c2pa::detail::c_string_to_string (T *c_result)
 Convert C string result to C++ string with cleanup.
 
std::vector< unsigned charc2pa::detail::to_byte_vector (const unsigned char *data, int64_t size)
 Convert C byte array result to C++ vector.
 

Detailed Description

Internal implementation details shared across c2pa_cpp source files.

This header is private to the library implementation and not installed, as it is used to share code inside c2pa_cpp SDK.