MeshLib
 
Loading...
Searching...
No Matches
MR::RecentFilesStore Class Reference

#include <MRRecentFilesStore.h>

Public Member Functions

 RecentFilesStore ()=default
 
 RecentFilesStore (std::string appName, int capacity=10)
 
MRVIEWER_API void storeFile (const std::filesystem::path &file) const
 
MRVIEWER_API std::vector< std::filesystem::path > getStoredFiles () const
 Returns filenames from storage.
 
int getCapacity () const
 Returns maximum size of recently opened files stack.
 
MRVIEWER_API boost::signals2::connection onUpdate (const boost::function< void(const FileNamesStack &files)> &slot, boost::signals2::connect_position position=boost::signals2::at_back)
 Connects given slot to receive signal on every update of this store.
 

Detailed Description

This class exists to store and load recently opened files from system storage (registry for Windows)

Constructor & Destructor Documentation

◆ RecentFilesStore() [1/2]

MR::RecentFilesStore::RecentFilesStore ( )
default

◆ RecentFilesStore() [2/2]

MR::RecentFilesStore::RecentFilesStore ( std::string appName,
int capacity = 10 )
inline

Capacity is maximum stored filenames, it needs app name to store data to correct place in system storage

Member Function Documentation

◆ getCapacity()

int MR::RecentFilesStore::getCapacity ( ) const
inline

Returns maximum size of recently opened files stack.

◆ getStoredFiles()

MRVIEWER_API std::vector< std::filesystem::path > MR::RecentFilesStore::getStoredFiles ( ) const

Returns filenames from storage.

◆ onUpdate()

MRVIEWER_API boost::signals2::connection MR::RecentFilesStore::onUpdate ( const boost::function< void(const FileNamesStack &files)> & slot,
boost::signals2::connect_position position = boost::signals2::at_back )

Connects given slot to receive signal on every update of this store.

◆ storeFile()

MRVIEWER_API void MR::RecentFilesStore::storeFile ( const std::filesystem::path & file) const

Saves filename on top of recently opened stack, if file is already in the storage put it on top


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