Various minor whitespace and consistency fixes.
[pulseview.git] / pv / devices / sessionfile.cpp
index 687c52bdcd5a225a29d1cdfaeffac104b7c4c9a3..8a583eeba0ffb08b8015da6fd5f6890d77488c7f 100644 (file)
 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