sequencer
Namespaces | Macros | Functions | Variables
device_spec_reader.hpp File Reference
#include <sequencer/midi/device_spec.hpp>
#include <fstream>
#include <iostream>
#include <regex>
#include <string>
#include <vector>
Include dependency graph for device_spec_reader.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 sequencer::midi
 

Macros

#define X(type, name, is_optional)
 

Functions

std::regex sequencer::midi::get_key_int_regex (const std::string &key)
 
void sequencer::midi::read_entry (device_entry_t &entry, const std::string &buffer)
 
std::vector< section_t > sequencer::midi::read_file (std::istream &file)
 

Variables

const auto sequencer::midi::key_sep = std::string( ":" )
 
const auto sequencer::midi::string_identifier_regex_str = std::string{"([a-zA-Z]+[\\sa-zA-Z0-9_]*)"}
 

Macro Definition Documentation

◆ X

#define X (   type,
  name,
  is_optional 
)
Value:
if ( std::regex_search( buffer, match, get_key_int_regex( #name ) ) ) \
{ \
entry.name = decltype( entry.name )( std::stoi( match[ 1 ] ) ); \
} \
else \
{ \
if constexpr ( !( is_optional ) ) \
{ \
throw std::runtime_error( "Could not parse '" #name "' in line: " + buffer ); \
} \
}
std::regex get_key_int_regex(const std::string &key)
Definition: device_spec_reader.hpp:16