namespace pv {
namespace devices {
-SessionFile::SessionFile(const std::shared_ptr<sigrok::Context> &context,
+SessionFile::SessionFile(const std::shared_ptr<sigrok::Context> context,
const std::string &file_name) :
- context_(context),
- file_name_(file_name) {
+ File(file_name),
+ context_(context)
+{
}
-std::string SessionFile::full_name() const {
- return boost::filesystem::path(file_name_).filename().string();
-}
-
-std::string SessionFile::display_name(const DeviceManager&) const {
- return SessionFile::full_name();
-}
+void SessionFile::open()
+{
+ if (session_)
+ close();
-void SessionFile::create() {
session_ = context_->load_session(file_name_);
device_ = session_->devices()[0];
}
+void SessionFile::close()
+{
+ if (session_)
+ session_->remove_devices();
+}
+
} // namespace devices
} // namespace pv