Guitarix
gx_system::PresetFile Class Reference

#include <gx_json.h>

Inheritance diagram for gx_system::PresetFile:
gx_system::PresetFileGui

Classes

class  Position
 

Public Types

enum  { PRESET_SEP = -1 , PRESET_SCRATCH = 0 , PRESET_FILE = 1 , PRESET_FACTORY = 2 }
 
typedef std::vector< Position >::iterator iterator
 

Public Member Functions

 PresetFile ()
 
 ~PresetFile ()
 
void readJSON_remote (JsonParser &jp)
 
void writeJSON_remote (JsonWriter &jw)
 
bool open_file (const Glib::ustring &name, const std::string &path, int tp, int flags)
 
bool create_file (const Glib::ustring &name, const std::string &path, int tp, int flags)
 
bool set_factory (const Glib::ustring &name_, const std::string &path)
 
bool readJSON (const std::string &dirpath, JsonParser &jp, bool *mtime_diff)
 
void writeJSON (JsonWriter &jw)
 
void reopen ()
 
void open (const std::string &fname)
 
void close ()
 
bool fail ()
 
bool ensure_is_current ()
 
void check_flags ()
 
const std::string & get_filename () const
 
const SettingsFileHeaderget_header ()
 
int size ()
 
void fill_names (vector< Glib::ustring > &)
 
const Glib::ustring & get_name (int n)
 
int get_index (const Glib::ustring &name)
 
JsonParsercreate_reader (int n)
 
JsonParsercreate_reader (const Glib::ustring &name)
 
JsonWritercreate_writer (int n)
 
JsonWritercreate_writer (const Glib::ustring &name)
 
JsonWritercreate_writer_at (const Glib::ustring &pos, const Glib::ustring &name)
 
PresetTransformercreate_transformer ()
 
bool clear ()
 
bool erase (const Glib::ustring &name)
 
bool rename (const Glib::ustring &name, Glib::ustring newname)
 
bool has_entry (const Glib::ustring &name)
 
void append (const Glib::ustring &name)
 
void insert_before (const Glib::ustring &nm, const Glib::ustring &newentry)
 
void insert_after (const Glib::ustring &nm, const Glib::ustring &newentry)
 
int get_flags () const
 
void set_flags (int f)
 
void set_flag (int flag, bool v)
 
int get_type () const
 
const Glib::ustring & get_name () const
 
bool set_name (const Glib::ustring &n, const std::string &newfile)
 
bool remove_file ()
 
iterator begin ()
 
iterator end ()
 
bool is_moveable () const
 
bool is_mutable () const
 
PresetFileGuiget_guiwrapper ()
 
bool is_newer (time_t m)
 

Protected Member Functions

void open ()
 

Protected Attributes

std::string filename
 
ifstream * is
 
time_t mtime
 
SettingsFileHeader header
 
std::vector< Positionentries
 
Glib::ustring name
 
int tp
 
int flags
 

Friends

class gx_engine::GxMachineRemote
 

Detailed Description

Definition at line 299 of file gx_json.h.

Member Typedef Documentation

◆ iterator

typedef std::vector<Position>::iterator gx_system::PresetFile::iterator

Definition at line 321 of file gx_json.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
PRESET_SEP 
PRESET_SCRATCH 
PRESET_FILE 
PRESET_FACTORY 

Definition at line 301 of file gx_json.h.

Constructor & Destructor Documentation

◆ PresetFile()

gx_system::PresetFile::PresetFile ( )

◆ ~PresetFile()

gx_system::PresetFile::~PresetFile ( )
inline

Definition at line 323 of file gx_json.h.

Member Function Documentation

◆ append()

void gx_system::PresetFile::append ( const Glib::ustring &  name)

◆ begin()

iterator gx_system::PresetFile::begin ( )

◆ check_flags()

void gx_system::PresetFile::check_flags ( )

◆ clear()

bool gx_system::PresetFile::clear ( )

◆ close()

void gx_system::PresetFile::close ( void  )
inline

Definition at line 333 of file gx_json.h.

◆ create_file()

bool gx_system::PresetFile::create_file ( const Glib::ustring &  name,
const std::string &  path,
int  tp,
int  flags 
)

◆ create_reader() [1/2]

JsonParser * gx_system::PresetFile::create_reader ( const Glib::ustring &  name)
inline

Definition at line 344 of file gx_json.h.

◆ create_reader() [2/2]

JsonParser * gx_system::PresetFile::create_reader ( int  n)

Referenced by create_reader().

◆ create_transformer()

PresetTransformer * gx_system::PresetFile::create_transformer ( )

◆ create_writer() [1/2]

JsonWriter * gx_system::PresetFile::create_writer ( const Glib::ustring &  name)

◆ create_writer() [2/2]

JsonWriter * gx_system::PresetFile::create_writer ( int  n)
inline

Definition at line 346 of file gx_json.h.

Referenced by create_writer().

◆ create_writer_at()

JsonWriter * gx_system::PresetFile::create_writer_at ( const Glib::ustring &  pos,
const Glib::ustring &  name 
)

◆ end()

iterator gx_system::PresetFile::end ( )
inline

Definition at line 366 of file gx_json.h.

◆ ensure_is_current()

bool gx_system::PresetFile::ensure_is_current ( )

◆ erase()

bool gx_system::PresetFile::erase ( const Glib::ustring &  name)

◆ fail()

bool gx_system::PresetFile::fail ( )

◆ fill_names()

void gx_system::PresetFile::fill_names ( vector< Glib::ustring > &  )

◆ get_filename()

const std::string & gx_system::PresetFile::get_filename ( ) const
inline

Definition at line 337 of file gx_json.h.

◆ get_flags()

int gx_system::PresetFile::get_flags ( ) const
inline

Definition at line 358 of file gx_json.h.

◆ get_guiwrapper()

PresetFileGui * gx_system::PresetFile::get_guiwrapper ( )
inline

◆ get_header()

const SettingsFileHeader & gx_system::PresetFile::get_header ( )

◆ get_index()

int gx_system::PresetFile::get_index ( const Glib::ustring &  name)

Referenced by create_reader(), and has_entry().

◆ get_name() [1/2]

const Glib::ustring & gx_system::PresetFile::get_name ( ) const
inline

Definition at line 362 of file gx_json.h.

Referenced by create_writer().

◆ get_name() [2/2]

const Glib::ustring & gx_system::PresetFile::get_name ( int  n)

◆ get_type()

int gx_system::PresetFile::get_type ( ) const
inline

Definition at line 361 of file gx_json.h.

◆ has_entry()

bool gx_system::PresetFile::has_entry ( const Glib::ustring &  name)
inline

Definition at line 354 of file gx_json.h.

◆ insert_after()

void gx_system::PresetFile::insert_after ( const Glib::ustring &  nm,
const Glib::ustring &  newentry 
)

◆ insert_before()

void gx_system::PresetFile::insert_before ( const Glib::ustring &  nm,
const Glib::ustring &  newentry 
)

◆ is_moveable()

bool gx_system::PresetFile::is_moveable ( ) const
inline

Definition at line 367 of file gx_json.h.

Referenced by is_mutable().

◆ is_mutable()

bool gx_system::PresetFile::is_mutable ( ) const
inline

Definition at line 368 of file gx_json.h.

◆ is_newer()

bool gx_system::PresetFile::is_newer ( time_t  m)

◆ open() [1/2]

void gx_system::PresetFile::open ( )
protected

Referenced by reopen().

◆ open() [2/2]

void gx_system::PresetFile::open ( const std::string &  fname)

◆ open_file()

bool gx_system::PresetFile::open_file ( const Glib::ustring &  name,
const std::string &  path,
int  tp,
int  flags 
)

◆ readJSON()

bool gx_system::PresetFile::readJSON ( const std::string &  dirpath,
JsonParser jp,
bool *  mtime_diff 
)

◆ readJSON_remote()

void gx_system::PresetFile::readJSON_remote ( JsonParser jp)

◆ remove_file()

bool gx_system::PresetFile::remove_file ( )

◆ rename()

bool gx_system::PresetFile::rename ( const Glib::ustring &  name,
Glib::ustring  newname 
)

◆ reopen()

void gx_system::PresetFile::reopen ( )
inline

Definition at line 331 of file gx_json.h.

◆ set_factory()

bool gx_system::PresetFile::set_factory ( const Glib::ustring &  name_,
const std::string &  path 
)

◆ set_flag()

void gx_system::PresetFile::set_flag ( int  flag,
bool  v 
)
inline

Definition at line 360 of file gx_json.h.

◆ set_flags()

void gx_system::PresetFile::set_flags ( int  f)
inline

Definition at line 359 of file gx_json.h.

◆ set_name()

bool gx_system::PresetFile::set_name ( const Glib::ustring &  n,
const std::string &  newfile 
)

◆ size()

int gx_system::PresetFile::size ( )

◆ writeJSON()

void gx_system::PresetFile::writeJSON ( JsonWriter jw)

◆ writeJSON_remote()

void gx_system::PresetFile::writeJSON_remote ( JsonWriter jw)

Friends And Related Function Documentation

◆ gx_engine::GxMachineRemote

friend class gx_engine::GxMachineRemote
friend

Definition at line 317 of file gx_json.h.

Member Data Documentation

◆ entries

std::vector<Position> gx_system::PresetFile::entries
protected

Definition at line 313 of file gx_json.h.

Referenced by end().

◆ filename

std::string gx_system::PresetFile::filename
protected

Definition at line 309 of file gx_json.h.

Referenced by get_filename(), and reopen().

◆ flags

int gx_system::PresetFile::flags
protected

Definition at line 316 of file gx_json.h.

Referenced by get_flags(), is_mutable(), set_flag(), and set_flags().

◆ header

SettingsFileHeader gx_system::PresetFile::header
protected

Definition at line 312 of file gx_json.h.

◆ is

ifstream* gx_system::PresetFile::is
protected

Definition at line 310 of file gx_json.h.

Referenced by close(), reopen(), and ~PresetFile().

◆ mtime

time_t gx_system::PresetFile::mtime
protected

Definition at line 311 of file gx_json.h.

◆ name

Glib::ustring gx_system::PresetFile::name
protected

Definition at line 314 of file gx_json.h.

Referenced by create_reader(), get_name(), and has_entry().

◆ tp

int gx_system::PresetFile::tp
protected

Definition at line 315 of file gx_json.h.

Referenced by get_type(), and is_moveable().


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