fxos/include/fxos/library.h

58 lines
1.3 KiB
C++

//---
// fxos.library: Management of resource files into libraries
//---
#ifndef FXOS_LIBRARY_H
#define FXOS_LIBRARY_H
#include <fxos/target.h>
#include <fxos/symbols.h>
#include <string>
#include <vector>
#include <map>
namespace FxOS {
struct Library
{
Library() = default;
/* Add a new search path in the library. */
void add_path(std::string path);
/* Recursively explore the fxos data file in a folder. */
void explore(std::string path);
/* Directly load an fxos data file into the library. Normally called by
explore() only, but might be useful here. */
void load(std::string path);
/* List of search directories */
const std::vector<std::string> &paths() {
return m_paths;
}
/* Targets loaded by exploration */
const std::map<std::string, TargetDescription> &targets() {
return m_targets;
}
/* Simple list of assembly tables */
const std::vector<std::pair<std::string, int>> &asm_tables() {
return m_asmtables;
}
/* List of symbol tables */
const std::vector<SymbolTable> &sym_tables() {
return m_symtables;
}
private:
std::vector<std::string> m_paths;
std::map<std::string, TargetDescription> m_targets;
std::vector<std::pair<std::string, int>> m_asmtables;
std::vector<SymbolTable> m_symtables;
};
} /* namespace FxOS */
#endif /* FXOS_LIBRARY_H */