cellar/include/bottles.hpp

54 lines
1.2 KiB
C++
Raw Normal View History

2017-03-13 19:03:07 -07:00
#ifndef __BOTTLES_HPP
#define __BOTTLES_HPP
#pragma once
#include <map>
2017-03-13 19:03:07 -07:00
#include <string>
2017-03-23 12:06:29 -07:00
#include "commands.hpp"
2018-03-13 20:06:15 -07:00
#include "nlohmann/json.hpp"
2017-03-13 19:03:07 -07:00
using namespace std;
using json = nlohmann::json;
2017-03-13 19:03:07 -07:00
namespace cellar {
namespace bottles {
enum bottle_type {
bottle_error,
bottle_anonymous,
bottle_labelled,
bottle_symlink
};
class Bottle {
public:
// public members
bottle_type type;
json config;
string path;
string canonical_path;
// constructors
Bottle();
Bottle(string);
// methods
bool load_config();
bool save_config();
string get_config(string);
bool set_config(string, string);
};
extern Bottle active_bottle;
2017-03-23 12:06:29 -07:00
extern map<string, Bottle> get_bottles();
extern string resolve_bottle(string);
extern void cork(string, bool);
extern void press(string, vector<string>, bool);
extern void uncork(string);
2017-03-13 19:03:07 -07:00
}
}
#endif // __BOTTLES_HPP