ModErn Text Analysis
META Enumerates Textual Applications
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
meta::corpus::metadata Class Reference

Represents the collection of metadata for a document. More...

#include <metadata.h>

Classes

struct  field
 Tagged union to represent a single metadata field. More...
 
struct  field_info
 Pair for storing the schema: contains its name and type. More...
 
struct  metadata_input_stream
 

Public Types

enum  field_type : uint8_t { SIGNED_INT = 0, UNSIGNED_INT, DOUBLE, STRING }
 Type tag for a field.
 
using schema_type = std::vector< field_info >
 

Public Member Functions

 metadata (const char *start, const schema_type &sch)
 
template<class T >
util::optional< T > get (const std::string &name) const
 
const schema_type & schema () const
 Returns the schema for this metadata object.
 

Private Attributes

const schema_type * schema_
 pointer to the metadata_file's schema
 
const char * start_
 the start of the metadata within the metadata_file
 

Detailed Description

Represents the collection of metadata for a document.

Member Function Documentation

§ get()

template<class T >
util::optional<T> meta::corpus::metadata::get ( const std::string &  name) const
inline
Parameters
nameThe metadata field to obtain
Returns
the metadata associated with that field, if it exists, converted to type T.

The documentation for this class was generated from the following file: