libquentier 0.5.0
The library for rich desktop clients of Evernote service
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | Friends | List of all members
quentier::LocalStorageManager Class Reference
Inheritance diagram for quentier::LocalStorageManager:
Inheritance graph
[legend]
Collaboration diagram for quentier::LocalStorageManager:
Collaboration graph
[legend]

Public Types

enum class  StartupOption { ClearDatabase = 1 , OverrideLock = 2 }
 The StartupOption enum is a QFlags enum which allows to specify some options to be applied to the local storage database on startup or on call to switchUser method. More...
 
enum class  ListObjectsOption {
  ListAll = 0 , ListDirty = 1 , ListNonDirty = 2 , ListElementsWithoutGuid = 4 ,
  ListElementsWithGuid = 8 , ListLocal = 16 , ListNonLocal = 32 , ListFavoritedElements = 64 ,
  ListNonFavoritedElements = 128
}
 The ListObjectsOption enum is a QFlags enum which allows to specify the desired local storage elements in calls to methods listing them from the database. More...
 
enum class  OrderDirection { Ascending = 0 , Descending }
 The OrderDirection enum specifies the direction of ordering of the results for methods listing the objects from the local storage database.
 
enum class  ListNotebooksOrder {
  ByUpdateSequenceNumber = 0 , ByNotebookName , ByCreationTimestamp , ByModificationTimestamp ,
  NoOrder
}
 The ListNotebooksOrder allows to specify the results ordering for methods listing notebooks from the local storage database.
 
enum class  ListLinkedNotebooksOrder { ByUpdateSequenceNumber = 0 , ByShareName , ByUsername , NoOrder }
 The ListLinkedNotebooksOrder enum allows to specify the results ordering for methods listing linked notebooks from local storage.
 
enum class  NoteCountOption { IncludeNonDeletedNotes = 1 , IncludeDeletedNotes = 2 }
 The NoteCountOption enum is a QFlags enum which allows to specify some options for methods returning note counts from local storage.
 
enum class  UpdateNoteOption { UpdateResourceMetadata = 1 , UpdateResourceBinaryData = 2 , UpdateTags = 4 }
 The UpdateNoteOption enum is a QFlags enum which allows to specify which note fields should be updated when updateNote method is called. More...
 
enum class  GetNoteOption { WithResourceMetadata = 1 , WithResourceBinaryData = 2 }
 The GetNoteOption enum is a QFlags enum which allows to specify which note fields should be included when findNote or one of listNote* methods is called. More...
 
enum class  ListNotesOrder {
  ByUpdateSequenceNumber = 0 , ByTitle , ByCreationTimestamp , ByModificationTimestamp ,
  ByDeletionTimestamp , ByAuthor , BySource , BySourceApplication ,
  ByReminderTime , ByPlaceName , NoOrder
}
 The ListNotesOrder enum allows to specify the results ordering for methods listing notes from the local storage database.
 
enum class  ListTagsOrder { ByUpdateSequenceNumber , ByName , NoOrder }
 The ListTagsOrder enum allows to specify the results ordering for methods listing tags from the local storage database.
 
enum class  GetResourceOption { WithBinaryData = 1 }
 The GetResourceOption enum is a QFlags enum which allows to specify which resource fields should be included when findEnResource method is called. More...
 
enum class  ListSavedSearchesOrder { ByUpdateSequenceNumber = 0 , ByName , ByFormat , NoOrder }
 The ListSavedSearchesOrder enum allows to specify the results ordering for methods listing saved searches from local storage.
 

Signals

void upgradeProgress (double progress)
 LocalStorageManager is capable of performing automatic database upgrades if/when it is necessary.
 

Public Member Functions

 LocalStorageManager (const Account &account, const StartupOptions options={}, QObject *parent=nullptr)
 LocalStorageManager - constructor. Takes in the account for which the LocalStorageManager instance is created plus some other parameters determining the startup behaviour.
 
void switchUser (const Account &account, const StartupOptions options={})
 switchUser - switches to another local storage database file associated with the passed in account
 
bool isLocalStorageVersionTooHigh (ErrorString &errorDescription)
 
bool localStorageRequiresUpgrade (ErrorString &errorDescription)
 
QVector< std::shared_ptr< ILocalStoragePatch > > requiredLocalStoragePatches ()
 
qint32 localStorageVersion (ErrorString &errorDescription)
 
qint32 highestSupportedLocalStorageVersion () const
 
int userCount (ErrorString &errorDescription) const
 userCount returns the number of non-deleted users currently stored in the local storage database
 
bool addUser (const User &user, ErrorString &errorDescription)
 addUser adds the passed in User object to the local storage database
 
bool updateUser (const User &user, ErrorString &errorDescription)
 updateUser updates the passed in User object in the local storage database
 
bool findUser (User &user, ErrorString &errorDescription) const
 findUser attempts to find and fill the fields of the passed in User object which must have "id" field set as this value is used as the identifier of User objects in the local storage database
 
bool deleteUser (const User &user, ErrorString &errorDescription)
 deleteUser marks the user as deleted in local storage
 
bool expungeUser (const User &user, ErrorString &errorDescription)
 expungeUser permanently deletes the user from the local storage database
 
int notebookCount (ErrorString &errorDescription) const
 notebookCount returns the number of notebooks currently stored in the local storage database
 
bool addNotebook (Notebook &notebook, ErrorString &errorDescription)
 addNotebook adds the passed in Notebook to the local storage database
 
bool updateNotebook (Notebook &notebook, ErrorString &errorDescription)
 updateNotebook updates the passed in Notebook in the local storage database
 
bool findNotebook (Notebook &notebook, ErrorString &errorDescription) const
 findNotebook attempts to find and set all found fields of the passed in Notebook object
 
bool findDefaultNotebook (Notebook &notebook, ErrorString &errorDescription) const
 findDefaultNotebook attempts to find the default notebook in the local storage database.
 
bool findLastUsedNotebook (Notebook &notebook, ErrorString &errorDescription) const
 findLastUsedNotebook attempts to find the last used notebook in the local storage database.
 
bool findDefaultOrLastUsedNotebook (Notebook &notebook, ErrorString &errorDescription) const
 findDefaultOrLastUsedNotebook attempts to find either the default or the last used notebook in the local storage database.
 
QList< NotebooklistAllNotebooks (ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListNotebooksOrder order=ListNotebooksOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const
 listAllNotebooks attempts to list all notebooks within the current account from the local storage database.
 
QList< NotebooklistNotebooks (const ListObjectsOptions flag, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListNotebooksOrder order=ListNotebooksOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const
 listNotebooks attempts to list notebooks within the account according to the specified input flag
 
QList< SharedNotebooklistAllSharedNotebooks (ErrorString &errorDescription) const
 listAllSharedNotebooks attempts to list all shared notebooks within the account.
 
QList< SharedNotebooklistSharedNotebooksPerNotebookGuid (const QString &notebookGuid, ErrorString &errorDescription) const
 listSharedNotebooksPerNotebookGuid - attempts to list all shared notebooks per given notebook's remote guid (not local uid, it's important).
 
bool expungeNotebook (Notebook &notebook, ErrorString &errorDescription)
 expungeNotebook permanently deletes the specified notebook from the local storage database.
 
int linkedNotebookCount (ErrorString &errorDescription) const
 linkedNotebookCount returns the number of linked notebooks stored in the local storage database.
 
bool addLinkedNotebook (const LinkedNotebook &linkedNotebook, ErrorString &errorDescription)
 addLinkedNotebook adds passed in LinkedNotebook to the local storage database; LinkedNotebook must have "remote" Evernote service's guid set. It is not possible to add a linked notebook in offline mode so it doesn't make sense for LinkedNotebook objects to not have guid.
 
bool updateLinkedNotebook (const LinkedNotebook &linkedNotebook, ErrorString &errorDescription)
 updateLinkedNotebook updates passd in LinkedNotebook in the local storage database; LinkedNotebook must have "remote" Evernote service's guid set.
 
bool findLinkedNotebook (LinkedNotebook &linkedNotebook, ErrorString &errorDescription) const
 findLinkedNotebook attempts to find and set all found fields for passed in by reference LinkedNotebook object. For LinkedNotebook local uid doesn't mean anything because it can only be considered valid if it has "remote" Evernote service's guid set. So this passed in LinkedNotebook object must have guid set to identify the linked notebook in the local storage database.
 
QList< LinkedNotebooklistAllLinkedNotebooks (ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListLinkedNotebooksOrder order=ListLinkedNotebooksOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending) const
 listAllLinkedNotebooks - attempts to list all linked notebooks within the account.
 
QList< LinkedNotebooklistLinkedNotebooks (const ListObjectsOptions flag, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListLinkedNotebooksOrder order=ListLinkedNotebooksOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending) const
 listLinkedNotebooks attempts to list linked notebooks within the account according to the specified input flag.
 
bool expungeLinkedNotebook (const LinkedNotebook &linkedNotebook, ErrorString &errorDescription)
 expungeLinkedNotebook permanently deletes specified linked notebook from the local storage database.
 
int noteCount (ErrorString &errorDescription, const NoteCountOptions options=NoteCountOption::IncludeNonDeletedNotes) const
 noteCount returns the number of notes currently stored in the local storage database.
 
int noteCountPerNotebook (const Notebook &notebook, ErrorString &errorDescription, const NoteCountOptions options=NoteCountOption::IncludeNonDeletedNotes) const
 noteCountPerNotebook returns the number of notes currently stored in the local storage database per given notebook.
 
int noteCountPerTag (const Tag &tag, ErrorString &errorDescription, const NoteCountOptions options=NoteCountOption::IncludeNonDeletedNotes) const
 noteCountPerTag returns the number of notes currently stored in local storage database labeled with given tag.
 
bool noteCountsPerAllTags (QHash< QString, int > &noteCountsPerTagLocalUid, ErrorString &errorDescription, const NoteCountOptions options=NoteCountOption::IncludeNonDeletedNotes) const
 noteCountsPerAllTags returns the number of notes currently stored in local storage database labeled with each tag stored in the local storage database.
 
int noteCountPerNotebooksAndTags (const QStringList &notebookLocalUids, const QStringList &tagLocalUids, ErrorString &errorDescription, const NoteCountOptions options=NoteCountOption::IncludeNonDeletedNotes) const
 noteCountPerNotebooksAndTags returns the number of notes currently stored in local storage database belonging to one of notebooks corresponding to given notebook local uids and labeled by at least one of tags corresponding to given tag local uids
 
bool addNote (Note &note, ErrorString &errorDescription)
 addNote adds passed in Note to the local storage database.
 
bool updateNote (Note &note, const UpdateNoteOptions options, ErrorString &errorDescription)
 updateNote updates passed in Note in the local storage database.
 
bool findNote (Note &note, const GetNoteOptions options, ErrorString &errorDescription) const
 findNote - attempts to find note in the local storage database
 
QList< NotelistNotesPerNotebook (const Notebook &notebook, const GetNoteOptions options, ErrorString &errorDescription, const ListObjectsOptions &flag=ListObjectsOption::ListAll, const size_t limit=0, const size_t offset=0, const ListNotesOrder &order=ListNotesOrder::NoOrder, const OrderDirection &orderDirection=OrderDirection::Ascending) const
 listNotesPerNotebook attempts to list notes per given notebook
 
QList< NotelistNotesPerTag (const Tag &tag, const GetNoteOptions options, ErrorString &errorDescription, const ListObjectsOptions &flag=ListObjectsOption::ListAll, const size_t limit=0, const size_t offset=0, const ListNotesOrder &order=ListNotesOrder::NoOrder, const OrderDirection &orderDirection=OrderDirection::Ascending) const
 listNotesPerTag attempts to list notes labeled with a given tag
 
QList< NotelistNotesPerNotebooksAndTags (const QStringList &notebookLocalUids, const QStringList &tagLocalUids, const GetNoteOptions options, ErrorString &errorDescription, const ListObjectsOptions &flag=ListObjectsOption::ListAll, const size_t limit=0, const size_t offset=0, const ListNotesOrder &order=ListNotesOrder::NoOrder, const OrderDirection &orderDirection=OrderDirection::Ascending) const
 listNotesPerNotebooksAndTags attempts to list notes which are present within one of specified notebooks and are labeled with at least one of specified tags
 
QList< NotelistNotesByLocalUids (const QStringList &noteLocalUids, const GetNoteOptions options, ErrorString &errorDescription, const ListObjectsOptions &flag=ListObjectsOption::ListAll, const size_t limit=0, const size_t offset=0, const ListNotesOrder &order=ListNotesOrder::NoOrder, const OrderDirection &orderDirection=OrderDirection::Ascending) const
 listNotesByLocalUids attempts to list notes given their local uids
 
QList< NotelistNotes (const ListObjectsOptions flag, const GetNoteOptions options, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListNotesOrder order=ListNotesOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const
 listNotes attempts to list notes within the account according to the specified input flag.
 
QStringList findNoteLocalUidsWithSearchQuery (const NoteSearchQuery &noteSearchQuery, ErrorString &errorDescription) const
 findNoteLocalUidsWithSearchQuery attempts to find note local uids of notes corresponding to the passed in NoteSearchQuery object.
 
NoteList findNotesWithSearchQuery (const NoteSearchQuery &noteSearchQuery, const GetNoteOptions options, ErrorString &errorDescription) const
 findNotesWithSearchQuery attempts to find notes corresponding to the passed in NoteSearchQuery object.
 
bool expungeNote (Note &note, ErrorString &errorDescription)
 expungeNote permanently deletes note from local storage.
 
int tagCount (ErrorString &errorDescription) const
 tagCount returns the number of non-deleted tags currently stored in the local storage database.
 
bool addTag (Tag &tag, ErrorString &errorDescription)
 addTag adds passed in Tag to the local storage database. If tag has "remote" Evernote service's guid set, it is identified in the database by this guid. Otherwise it is identified by local uid.
 
bool updateTag (Tag &tag, ErrorString &errorDescription)
 updateTag updates passed in Tag in the local storage database.
 
bool findTag (Tag &tag, ErrorString &errorDescription) const
 findTag attempts to find and fill the fields of passed in tag object.
 
QList< TaglistAllTagsPerNote (const Note &note, ErrorString &errorDescription, const ListObjectsOptions &flag=ListObjectsOption::ListAll, const size_t limit=0, const size_t offset=0, const ListTagsOrder &order=ListTagsOrder::NoOrder, const OrderDirection &orderDirection=OrderDirection::Ascending) const
 listAllTagsPerNote lists all tags per given note
 
QList< TaglistAllTags (ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListTagsOrder order=ListTagsOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const
 listAllTags lists all tags within the current user's account.
 
QList< TaglistTags (const ListObjectsOptions flag, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListTagsOrder &order=ListTagsOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const
 listTags attempts to list tags within the account according to the specified input flag.
 
QList< std::pair< Tag, QStringList > > listTagsWithNoteLocalUids (const ListObjectsOptions flag, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListTagsOrder &order=ListTagsOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const
 listTagsWithNoteLocalUids attempts to list tags and their corresponding local uids within the account according to the specified input flag
 
bool expungeTag (Tag &tag, QStringList &expungedChildTagLocalUids, ErrorString &errorDescription)
 expungeTag permanently deletes tag from the local storage database.
 
bool expungeNotelessTagsFromLinkedNotebooks (ErrorString &errorDescription)
 expungeNotelessTagsFromLinkedNotebooks permanently deletes from the local storage database those tags which belong to some linked notebook and are not linked with any notes.
 
int enResourceCount (ErrorString &errorDescription) const
 enResourceCount (the name is not Resource to prevent problems with macro defined on some versions of Windows) returns the number of resources currently stored in the local storage database.
 
bool addEnResource (Resource &resource, ErrorString &errorDescription)
 addEnResource adds passed in resource to the local storage database.
 
bool updateEnResource (Resource &resource, ErrorString &errorDescription)
 updateEnResource updates passed in resource in the local storage database.
 
bool findEnResource (Resource &resource, const GetResourceOptions options, ErrorString &errorDescription) const
 findEnResource method attempts to find resource in the local storage database
 
bool expungeEnResource (Resource &resource, ErrorString &errorDescription)
 expungeResource permanently deletes resource from the local storage database.
 
int savedSearchCount (ErrorString &errorDescription) const
 savedSearchCount returns the number of saved seacrhes currently stored in local storage database.
 
bool addSavedSearch (SavedSearch &search, ErrorString &errorDescription)
 addSavedSearch adds passed in SavedSearch to the local storage database; if search has "remote" Evernote service's guid set, it is identified in the database by this guid. Otherwise it is identified by local uid.
 
bool updateSavedSearch (SavedSearch &search, ErrorString &errorDescription)
 updateSavedSearch updates passed in SavedSearch in the local storage database.
 
bool findSavedSearch (SavedSearch &search, ErrorString &errorDescription) const
 findSavedSearch attempts to find and fill the fields of passed in saved search object.
 
QList< SavedSearchlistAllSavedSearches (ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListSavedSearchesOrder order=ListSavedSearchesOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending) const
 listAllSavedSearches lists all saved searches within the account.
 
QList< SavedSearchlistSavedSearches (const ListObjectsOptions flag, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListSavedSearchesOrder order=ListSavedSearchesOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending) const
 listSavedSearches attempts to list saved searches within the account according to the specified input flag.
 
bool expungeSavedSearch (SavedSearch &search, ErrorString &errorDescription)
 expungeSavedSearch permanently deletes saved search from the local storage database.
 
qint32 accountHighUsn (const QString &linkedNotebookGuid, ErrorString &errorDescription)
 accountHighUsn returns the highest update sequence number within the data elements stored in the local storage database, either for user's own account or for some linked notebook.
 

Friends

QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const StartupOption option)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &dbg, const StartupOption option)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const StartupOptions options)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &dbg, const StartupOptions options)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const ListObjectsOption option)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &dbg, const ListObjectsOption option)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const ListObjectsOptions options)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &dbg, const ListObjectsOptions options)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const OrderDirection orderDirection)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &dbg, const OrderDirection orderDirection)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const ListNotebooksOrder order)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &dbg, const ListNotebooksOrder order)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const ListLinkedNotebooksOrder order)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &strm, const ListLinkedNotebooksOrder order)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const NoteCountOption option)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &dbg, const NoteCountOption option)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const NoteCountOptions options)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &strm, const NoteCountOptions options)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const UpdateNoteOption option)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &strm, const UpdateNoteOption option)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const UpdateNoteOptions options)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &strm, const UpdateNoteOptions options)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const GetNoteOption option)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &dbg, const GetNoteOption option)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const GetNoteOptions options)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &strm, const GetNoteOptions options)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const ListNotesOrder order)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &strm, const ListNotesOrder order)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const ListTagsOrder order)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &strm, const ListTagsOrder order)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const GetResourceOption option)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &strm, const GetResourceOption option)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const GetResourceOptions options)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &strm, const GetResourceOptions options)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, const ListSavedSearchesOrder order)
 
QUENTIER_EXPORT QDebug & operator<< (QDebug &strm, const ListSavedSearchesOrder order)
 

Member Enumeration Documentation

◆ GetNoteOption

The GetNoteOption enum is a QFlags enum which allows to specify which note fields should be included when findNote or one of listNote* methods is called.

Most note data is included unconditionally - note title, content, attributes (if any) etc. However, some specific data can be opted to not be included into the returned note data - notably, metadata of resources and binary data of resources. If these are omitted, findNote or any of listNote* methods might work faster than otherwise

Enumerator
WithResourceMetadata 

WithResourceMetadata value specifies that fields aside dataBody, dataSize, dataHash, alternateDataBody, alternateDataSize, alternateDataHash for each note's resource should be included

WithResourceBinaryData 

WithResourceBinaryData value specifies that dataBody, its size and hash and alternateDataBody, its size and hash should be included into each of note's resources; this value only has effect if flags also have WithResourceMetadata value enabled!

◆ GetResourceOption

The GetResourceOption enum is a QFlags enum which allows to specify which resource fields should be included when findEnResource method is called.

Most resource data is included unconditionally but some specific data can be opted to not be included into the returned resource data - notably, binary data of the resource. If it is omitted, findEnResource method might work faster than otherwise

Enumerator
WithBinaryData 

WithBinaryData value specifies than dataBody and alternateDataBody should be included into the returned resource

◆ ListObjectsOption

The ListObjectsOption enum is a QFlags enum which allows to specify the desired local storage elements in calls to methods listing them from the database.

For example, one can either list all available elements of certain type from local storage or only elements marked as dirty (modified locally, not yet synchronized) or elements never synchronized with the remote storage or elements which are synchronizable with the remote storage etc.

◆ StartupOption

The StartupOption enum is a QFlags enum which allows to specify some options to be applied to the local storage database on startup or on call to switchUser method.

Enumerator
ClearDatabase 

If ClearDatabase flag is active, LocalStorageManager would wipe any existing database contents; the net effect would be as if no database existed for the given user before the creation of LocalStorageManager or before the call to its switchUser method

OverrideLock 

If OverrideLock flag is active, LocalStorageManager would ignore the existing advisory lock (if any) put on the database file; if this flag is not active, the attempt to create LocalStorageManager (or the attempt to call its switchUser method) with the advisory lock on the database file put by someone else would cause the throwing of DatabaseLockedException

◆ UpdateNoteOption

The UpdateNoteOption enum is a QFlags enum which allows to specify which note fields should be updated when updateNote method is called.

Most note data is updated unconditionally - note title, content, attributes (if any) etc. However, some specific data can be chosen to not update - notably, metadata of resources, binary data of resources or lists of note's tags

Enumerator
UpdateResourceMetadata 

UpdateResourceMetadata value specifies that fields aside dataBody, dataSize, dataHash, alternateDataBody, alternateDataSize, alternateDataHash for each note's resource should be updated

UpdateResourceBinaryData 

UpdateResourceBinaryData value specifies that dataBody, its size and hash and alternateDataBody, its size and hash should be updated for each of note's resources; this value only has effect if flags also have UpdateResourceMetadata value enabled!

UpdateTags 

UpdateTags value specifies that note's tag lists should be updated

Constructor & Destructor Documentation

◆ LocalStorageManager()

quentier::LocalStorageManager::LocalStorageManager ( const Account account,
const StartupOptions  options = {},
QObject *  parent = nullptr 
)
explicit

LocalStorageManager - constructor. Takes in the account for which the LocalStorageManager instance is created plus some other parameters determining the startup behaviour.

Parameters
accountThe account for which the local storage is being created and initialized
optionsStartup options for the local storage, none enabled by default
parentParent QObject

Member Function Documentation

◆ accountHighUsn()

qint32 quentier::LocalStorageManager::accountHighUsn ( const QString &  linkedNotebookGuid,
ErrorString errorDescription 
)

accountHighUsn returns the highest update sequence number within the data elements stored in the local storage database, either for user's own account or for some linked notebook.

Parameters
linkedNotebookGuidThe guid of the linked notebook for which the highest update sequence number is requested; if null or empty, the highest update sequence number for user's own account is returned
errorDescriptionError description if account's highest update sequence number could not be returned
Returns
Either the highest update sequence number - a non-negative value - or a negative number in case of error

◆ addEnResource()

bool quentier::LocalStorageManager::addEnResource ( Resource resource,
ErrorString errorDescription 
)

addEnResource adds passed in resource to the local storage database.

Parameters
resourceResource to be added to the database, must have either note's local uid set or note's "remote" Evernote service's guid set; may be changed as a result of the call, filled with autogenerated fields like local uid if it was empty before the call
errorDescriptionError description if resource could not be added
Returns
True if resource was added successfully, false otherwise

◆ addLinkedNotebook()

bool quentier::LocalStorageManager::addLinkedNotebook ( const LinkedNotebook linkedNotebook,
ErrorString errorDescription 
)

addLinkedNotebook adds passed in LinkedNotebook to the local storage database; LinkedNotebook must have "remote" Evernote service's guid set. It is not possible to add a linked notebook in offline mode so it doesn't make sense for LinkedNotebook objects to not have guid.

Parameters
linkedNotebookLinkedNotebook to be added to the local storage database
errorDescriptionError description if linked notebook could not be added
Returns
True if linked notebook was added successfully, false otherwise

◆ addNote()

bool quentier::LocalStorageManager::addNote ( Note note,
ErrorString errorDescription 
)

addNote adds passed in Note to the local storage database.

Parameters
noteNote to be added to local storage database; required to contain either "remote" notebook guid or local notebook uid; may be changed as a result of the call, filled with autogenerated fields like local uid if it was empty before the call; also tag guids are filled if the note passed in contained only tag local uids and tag local uids are filled if the note passed in contained only tag guids
errorDescriptionError description if note could not be added
Returns
True if note was added successfully, false otherwise

◆ addNotebook()

bool quentier::LocalStorageManager::addNotebook ( Notebook notebook,
ErrorString errorDescription 
)

addNotebook adds the passed in Notebook to the local storage database

If the notebook has "remote" Evernote service's guid set, it is identified by this guid in the local storage database. Otherwise it is identified by the local uid

Parameters
notebookThe notebook to be added to the local storage database; the object is passed by reference and may be changed as a result of the call (filled with autocompleted fields like local uid if it was empty before the call)
errorDescriptionError description if the notebook could not be added
Returns
True if the notebook was added successfully, false otherwise

◆ addSavedSearch()

bool quentier::LocalStorageManager::addSavedSearch ( SavedSearch search,
ErrorString errorDescription 
)

addSavedSearch adds passed in SavedSearch to the local storage database; if search has "remote" Evernote service's guid set, it is identified in the database by this guid. Otherwise it is identified by local uid.

Parameters
searchSavedSearch to be added to the local storage; may be changed as a result of the call, filled with autogenerated fields like local uid if it was empty before the call
errorDescriptionError description if SavedSearch could not be added
Returns
True if SavedSearch was added successfully, false otherwise

◆ addTag()

bool quentier::LocalStorageManager::addTag ( Tag tag,
ErrorString errorDescription 
)

addTag adds passed in Tag to the local storage database. If tag has "remote" Evernote service's guid set, it is identified in the database by this guid. Otherwise it is identified by local uid.

Parameters
tagTag to be added to the local storage; may be changed as a result of the call, filled with autogenerated fields like local uid if it was empty before the call
errorDescriptionError description if Tag could not be added
Returns
True if Tag was added successfully, false otherwise

◆ addUser()

bool quentier::LocalStorageManager::addUser ( const User user,
ErrorString errorDescription 
)

addUser adds the passed in User object to the local storage database

The table with Users is only involved in operations with notebooks which have "contact" field set which in turn is used with business accounts

Parameters
userThe user to be added to the local storage database
errorDescriptionError description if the user could not be added
Returns
True if the user was added successfully, false otherwise

◆ deleteUser()

bool quentier::LocalStorageManager::deleteUser ( const User user,
ErrorString errorDescription 
)

deleteUser marks the user as deleted in local storage

Parameters
userThe user to be marked as deleted
errorDescriptionError description if the user could not be marked as deleted
Returns
True if the user was marked as deleted successfully, false otherwise

◆ enResourceCount()

int quentier::LocalStorageManager::enResourceCount ( ErrorString errorDescription) const

enResourceCount (the name is not Resource to prevent problems with macro defined on some versions of Windows) returns the number of resources currently stored in the local storage database.

Parameters
errorDescriptionError description if the number of resources could not be returned
Returns
Either non-negative value with the number of resources or -1 which means some error occurred

◆ expungeEnResource()

bool quentier::LocalStorageManager::expungeEnResource ( Resource resource,
ErrorString errorDescription 
)

expungeResource permanently deletes resource from the local storage database.

Parameters
resourceResource to be expunged; may be changed as a result of the call, automatically filled with local uid and note local uid and/or guid if these were empty before the call
errorDescriptionError description if resource could not be expunged
Returns
True if resource was expunged successfully, false otherwise

◆ expungeLinkedNotebook()

bool quentier::LocalStorageManager::expungeLinkedNotebook ( const LinkedNotebook linkedNotebook,
ErrorString errorDescription 
)

expungeLinkedNotebook permanently deletes specified linked notebook from the local storage database.

Evernote API doesn't allow to delete linked notebooks from the remote storage, it can only be done by official desktop client or web client. So this method should be called only during the synchronization with remote service, when some linked notebook is found to be deleted via either official desktop client or web cient.

Parameters
linkedNotebookLinked notebook to be expunged. Must have "remote" guid set
errorDescriptionError description if linked notebook could not be expunged
Returns
True if linked notebook was expunged successfully, false otherwise

◆ expungeNote()

bool quentier::LocalStorageManager::expungeNote ( Note note,
ErrorString errorDescription 
)

expungeNote permanently deletes note from local storage.

Evernote API doesn't allow to delete notes from the remote storage, it can only be done by official desktop client or web client. So this method should be called only during the synchronization with remote database, when some note is found to be deleted via either official desktop client or web client.

Parameters
noteNote to be expunged; may be changed as a result of the call, filled with fields like local uid or notebook guid or local uid
errorDescriptionError description if note could not be expunged
Returns
True if note was expunged successfully, false otherwise

◆ expungeNotebook()

bool quentier::LocalStorageManager::expungeNotebook ( Notebook notebook,
ErrorString errorDescription 
)

expungeNotebook permanently deletes the specified notebook from the local storage database.

Evernote API doesn't allow to delete the notebooks from the remote storage, it can only be done by the official desktop Evernote client or via its web client. So this method should be called only during the synchronization with the remote storage, when some notebook is found to be deleted via either the official desktop client or via the web client; also, this method can be called for local notebooks not synchronized with Evernote at all.

Parameters
notebookThe notebook to be expunged. Must have either "remote" guid or local uid set; the object is passed by reference and may be changed as a result of the call (filled with local uid if it was empty before the call)
errorDescriptionError description if the notebook could not be expunged
Returns
True if the notebook was expunged successfully, false otherwise

◆ expungeNotelessTagsFromLinkedNotebooks()

bool quentier::LocalStorageManager::expungeNotelessTagsFromLinkedNotebooks ( ErrorString errorDescription)

expungeNotelessTagsFromLinkedNotebooks permanently deletes from the local storage database those tags which belong to some linked notebook and are not linked with any notes.

Parameters
errorDescriptionError description if tag could not be expunged
Returns
True if relevant tags were expunged successfully, false otherwise

◆ expungeSavedSearch()

bool quentier::LocalStorageManager::expungeSavedSearch ( SavedSearch search,
ErrorString errorDescription 
)

expungeSavedSearch permanently deletes saved search from the local storage database.

Parameters
searchSaved search to be expunged; may be changed as a result of the call filled local uid if it was empty before the call
errorDescriptionError description if saved search could not be expunged
Returns
True if saved search was expunged successfully, false otherwise

◆ expungeTag()

bool quentier::LocalStorageManager::expungeTag ( Tag tag,
QStringList &  expungedChildTagLocalUids,
ErrorString errorDescription 
)

expungeTag permanently deletes tag from the local storage database.

Evernote API doesn't allow to delete tags from remote storage, it can only be done by official desktop client or web client. So this method should be called only during the synchronization with remote database, when some tag is found to be deleted via either official desktop client or web client.

Parameters
tagTag to be expunged; may be changed as a result of the call, automatically filled with local uid if it was empty before the call
expungedChildTagLocalUidsIf the expunged tag was a parent of some other tags, these were expunged as well; this parameter would contain the local uids of expunged child tags
errorDescriptionError description if tag could not be expunged
Returns
True if tag was expunged successfully, false otherwise

◆ expungeUser()

bool quentier::LocalStorageManager::expungeUser ( const User user,
ErrorString errorDescription 
)

expungeUser permanently deletes the user from the local storage database

Parameters
userThe user to be expunged
errorDescriptionError description if the user could not be expunged
Returns
True if the user was expunged successfully, false otherwise

◆ findDefaultNotebook()

bool quentier::LocalStorageManager::findDefaultNotebook ( Notebook notebook,
ErrorString errorDescription 
) const

findDefaultNotebook attempts to find the default notebook in the local storage database.

Parameters
notebookThe default notebook to be found
errorDescriptionError description if the default notebook could not be found
Returns
True if the default notebook was found, false otherwise

◆ findDefaultOrLastUsedNotebook()

bool quentier::LocalStorageManager::findDefaultOrLastUsedNotebook ( Notebook notebook,
ErrorString errorDescription 
) const

findDefaultOrLastUsedNotebook attempts to find either the default or the last used notebook in the local storage database.

Parameters
notebookEither the default or the last used notebook to be found
errorDescriptionError description if the default or the last used notebook could not be found
Returns
True if the default or the last used notebook were found, false otherwise

◆ findEnResource()

bool quentier::LocalStorageManager::findEnResource ( Resource resource,
const GetResourceOptions  options,
ErrorString errorDescription 
) const

findEnResource method attempts to find resource in the local storage database

Parameters
resourceResource to be found in the local storage database. If it has the "remote" Evernote service's guid set, this guid is used to identify the resource in the local storage database. Otherwise resource's local uid is used
optionsOptions specifying which optionally includable fields of the resource should actually be included
errorDescriptionError description if resource could not be found
Returns
True if resource was found successfully, false otherwise

◆ findLastUsedNotebook()

bool quentier::LocalStorageManager::findLastUsedNotebook ( Notebook notebook,
ErrorString errorDescription 
) const

findLastUsedNotebook attempts to find the last used notebook in the local storage database.

Parameters
notebookThe last used notebook to be found
errorDescriptionError description if the last used notebook could not be found
Returns
True if the last used notebook was found, false otherwise

◆ findLinkedNotebook()

bool quentier::LocalStorageManager::findLinkedNotebook ( LinkedNotebook linkedNotebook,
ErrorString errorDescription 
) const

findLinkedNotebook attempts to find and set all found fields for passed in by reference LinkedNotebook object. For LinkedNotebook local uid doesn't mean anything because it can only be considered valid if it has "remote" Evernote service's guid set. So this passed in LinkedNotebook object must have guid set to identify the linked notebook in the local storage database.

Parameters
linkedNotebookLinked notebook to be found. Must have "remote" guid set
errorDescriptionError description if linked notebook could not be found
Returns
True if linked notebook was found, false otherwise

◆ findNote()

bool quentier::LocalStorageManager::findNote ( Note note,
const GetNoteOptions  options,
ErrorString errorDescription 
) const

findNote - attempts to find note in the local storage database

Parameters
note- note to be found in the local storage database. Must have either local or "remote" Evernote service's guid set
options- options specifying which optionally includable fields of the note should actually be included
errorDescription- error description if note could not be found
Returns
true if note was found successfully, false otherwise

◆ findNotebook()

bool quentier::LocalStorageManager::findNotebook ( Notebook notebook,
ErrorString errorDescription 
) const

findNotebook attempts to find and set all found fields of the passed in Notebook object

If "remote" Evernote service's guid for the notebook is set, it is used to identify the notebook in the local storage database. Otherwise the notebook is identified by its local uid. If it's empty, the search would attempt to find the notebook by its name. If the name is also not set, the search would attempt to find the notebook by linked notebook guid assuming that no more than one notebook corresponds to the linked notebook guid. If linked notebook guid is also not set, the search would fail.

Important! Due to the fact that the notebook name is only unique within the users's own account as well as within each linked notebook, the result of the search by name depends on the notebook's linked notebook guid: if it is not set, the search by name would only search for the notebook with the specified name within the user's own account. If it is set, the search would only consider the linked notebook with the corresponding guid.

Parameters
notebookThe notebook to be found. Must have either "remote" or local uid or name or linked notebook guid set
errorDescriptionError description if the notebook could not be found
Returns
True if the notebook was found, false otherwise

◆ findNoteLocalUidsWithSearchQuery()

QStringList quentier::LocalStorageManager::findNoteLocalUidsWithSearchQuery ( const NoteSearchQuery noteSearchQuery,
ErrorString errorDescription 
) const

findNoteLocalUidsWithSearchQuery attempts to find note local uids of notes corresponding to the passed in NoteSearchQuery object.

Parameters
noteSearchQueryFilled NoteSearchQuery object used to filter the notes
errorDescriptionError description in case note local uids could not be listed
Returns
The list of found notes' local uids or empty list in case of error

◆ findNotesWithSearchQuery()

NoteList quentier::LocalStorageManager::findNotesWithSearchQuery ( const NoteSearchQuery noteSearchQuery,
const GetNoteOptions  options,
ErrorString errorDescription 
) const

findNotesWithSearchQuery attempts to find notes corresponding to the passed in NoteSearchQuery object.

Parameters
noteSearchQueryFilled NoteSearchQuery object used to filter the notes
optionsOptions specifying which optionally includable fields of the note should actually be included
errorDescriptionError description in case notes could not be listed
Returns
Either list of notes per NoteSearchQuery or empty list in case of error or no notes presence for the given NoteSearchQuery

◆ findSavedSearch()

bool quentier::LocalStorageManager::findSavedSearch ( SavedSearch search,
ErrorString errorDescription 
) const

findSavedSearch attempts to find and fill the fields of passed in saved search object.

If "remote" Evernote services's guid for the saved search is set, it would be used to identify the saved search in the local storage. Otherwise the local uid would be used. If neither guid not local uid are set, saved search's name would be used. If the name is also not set, the search for saved search would fail.

Parameters
searchSavedSearch to be found in the local storage database
errorDescriptionError description if SavedSearch could not be found
Returns
True if SavedSearch was found, false otherwise

◆ findTag()

bool quentier::LocalStorageManager::findTag ( Tag tag,
ErrorString errorDescription 
) const

findTag attempts to find and fill the fields of passed in tag object.

If "remote" Evernote service's guid for the tag is set, it would be used to identify the tag in the local storage database. Otherwise the local uid would be used. If neither guid nor local uid are set, tag's name would be used. If the name is also not set, the search would fail.

Important! Due to the fact that the tag name is only unique within the users's own account as well as within each linked notebook, the result of the search by name depends on the tag's linked notebook guid: if it is not set, the search by name would only search for the tag with the specified name within the user's own account. If it is set, the search would only consider tags from a linked notebook with the corresponding guid.

Parameters
tagTag to be found in the local storage database; must have either guid, local uid or name set
errorDescriptionError description in case tag could not be found
Returns
True if tag was found, false otherwise

◆ findUser()

bool quentier::LocalStorageManager::findUser ( User user,
ErrorString errorDescription 
) const

findUser attempts to find and fill the fields of the passed in User object which must have "id" field set as this value is used as the identifier of User objects in the local storage database

Parameters
userThe user to be found. Must have "id" field set
errorDescriptionError description if the user could not be found
Returns
True if the user was found successfully, false otherwise

◆ highestSupportedLocalStorageVersion()

qint32 quentier::LocalStorageManager::highestSupportedLocalStorageVersion ( ) const

highestSupportedLocalStorageVersion returns the highest version of local storage persistence which the current build of libquentier is capable of working with

Returns
Highest supported local storage version

◆ isLocalStorageVersionTooHigh()

bool quentier::LocalStorageManager::isLocalStorageVersionTooHigh ( ErrorString errorDescription)

isLocalStorageVersionTooHigh method checks whether the existing local storage persistence has version which is too high for the currenly run version of libquentier to work with i.e. whether the local storage has already been upgraded using a new version of libquentier.

NOTE: it is libquentier client code's responsibility to call this method and/or localStorageRequiresUpgrade method, libquentier won't call any of these on its own and will just attempt to work with the existing local storage, whatever version it is of. If version is too high, things can fail in most mysterious way, so the client code is obliged to call these methods to ensure the local storage version is checked properly.

Parameters
errorDescriptionTextual description of the error if the method was unable to determine whether the local storage version is too high for the currently run version of libquentier to work with, otherwise this parameter is not touched by the method
Returns
True if local storage version is too high for the currently run version of libquentier to work with, false otherwise

◆ linkedNotebookCount()

int quentier::LocalStorageManager::linkedNotebookCount ( ErrorString errorDescription) const

linkedNotebookCount returns the number of linked notebooks stored in the local storage database.

Parameters
errorDescriptionError description if the number of linked notebooks count not be returned
Returns
Either non-negative number of linked notebooks or -1 if some error has occurred

◆ listAllLinkedNotebooks()

QList< LinkedNotebook > quentier::LocalStorageManager::listAllLinkedNotebooks ( ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListLinkedNotebooksOrder  order = ListLinkedNotebooksOrder::NoOrder,
const OrderDirection  orderDirection = OrderDirection::Ascending 
) const

listAllLinkedNotebooks - attempts to list all linked notebooks within the account.

Parameters
errorDescriptionError description if linked notebooks could not be listed, otherwise this parameter is untouched
limitLimit for the max number of linked notebooks in the result, zero by default which means no limit is set
offsetNumber of linked notebooks to skip in the beginning of the result, zero by default
orderAllows to specify particular ordering of linked notebooks in the result, NoOrder by default
orderDirectionSpecifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder
Returns
Either list of all linked notebooks or empty list in case of error or no linked notebooks presence within the account

◆ listAllNotebooks()

QList< Notebook > quentier::LocalStorageManager::listAllNotebooks ( ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListNotebooksOrder  order = ListNotebooksOrder::NoOrder,
const OrderDirection  orderDirection = OrderDirection::Ascending,
const QString &  linkedNotebookGuid = QString() 
) const

listAllNotebooks attempts to list all notebooks within the current account from the local storage database.

Parameters
errorDescriptionError description if all notebooks could not be listed; if no error happens, this parameter is untouched
limitThe limit for the max number of notebooks in the result, zero by default which means no limit is set
offsetThe number of notebooks to skip in the beginning of the result, zero by default
orderAllows to specify a particular ordering of notebooks in the result, NoOrder by default
orderDirectionSpecifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder
linkedNotebookGuidIf it's null, the method would list the notebooks ignoring their belonging to the current account or to some linked notebook; if it's empty, only the non-linked notebooks would be listed; otherwise, the only one notebook from the corresponding linked notebook would be listed
Returns
Either the list of all notebooks within the account or empty list in cases of error or no notebooks presence within the account

◆ listAllSavedSearches()

QList< SavedSearch > quentier::LocalStorageManager::listAllSavedSearches ( ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListSavedSearchesOrder  order = ListSavedSearchesOrder::NoOrder,
const OrderDirection  orderDirection = OrderDirection::Ascending 
) const

listAllSavedSearches lists all saved searches within the account.

Parameters
errorDescriptionError description if all saved searches could not be listed; otherwise this parameter is untouched
limitLimit for the max number of saved searches in the result, zero by default which means no limit is set
offsetNumber of saved searches to skip in the beginning of the result, zero by default
orderAllows to specify particular ordering of saved searches in the result, NoOrder by default
orderDirectionSpecifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder
Returns
Either the list of all saved searches within the account or empty list in case of error or if there are no saved searches within the account

◆ listAllSharedNotebooks()

QList< SharedNotebook > quentier::LocalStorageManager::listAllSharedNotebooks ( ErrorString errorDescription) const

listAllSharedNotebooks attempts to list all shared notebooks within the account.

Parameters
errorDescriptionError description if shared notebooks could not be listed; if no error happens, this parameter is untouched
Returns
Either the list of all shared notebooks within the account or empty list in cases of error or no shared notebooks presence within the account

◆ listAllTags()

QList< Tag > quentier::LocalStorageManager::listAllTags ( ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListTagsOrder  order = ListTagsOrder::NoOrder,
const OrderDirection  orderDirection = OrderDirection::Ascending,
const QString &  linkedNotebookGuid = QString() 
) const

listAllTags lists all tags within the current user's account.

Parameters
errorDescriptionError description if tags were not listed successfully. In such case the returned list of tags would be empty and error description won't be empty. However, if, for example, the list of tags is empty and error description is empty too, it means the current account does not have any tags created.
limitLimit for the max number of tags in the result, zero by default which means no limit is set
offsetNumber of tags to skip in the beginning of the result, zero by default
orderAllows to specify particular ordering of tags in the result, NoOrder by default
orderDirectionSpecifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder
linkedNotebookGuidIf it's null, the method would list tags ignoring their belonging to the current account or to some linked notebook; if it's empty, only the tags from user's own account would be listed; otherwise, only the tags corresponding to the certain linked notebook would be listed
Returns
The list of found tags within the account

◆ listAllTagsPerNote()

QList< Tag > quentier::LocalStorageManager::listAllTagsPerNote ( const Note note,
ErrorString errorDescription,
const ListObjectsOptions &  flag = ListObjectsOption::ListAll,
const size_t  limit = 0,
const size_t  offset = 0,
const ListTagsOrder order = ListTagsOrder::NoOrder,
const OrderDirection orderDirection = OrderDirection::Ascending 
) const

listAllTagsPerNote lists all tags per given note

Parameters
noteNote for which the list of tags is requested. If it has "remote" Evernote service's guid set, it is used to identify the note in the local storage database. Otherwise its local uid is used for that.
errorDescriptionError description if tags were not listed successfully. In such case the returned list of tags would be empty and error description won't be empty. However, if, for example, the list of tags is empty and error description is empty too, it means the provided note does not have any tags assigned to it.
flagInput parameter used to set the filter for the desired tags to be listed
limitLimit for the max number of tags in the result, zero by default which means no limit is set
offsetNumber of tags to skip in the beginning of the result, zero by default
orderAllows to specify particular ordering of tags in the result, NoOrder by default
orderDirectionSpecifies the direction of ordering, by default ascending direction is used;
Returns
The list of found tags per note

◆ listLinkedNotebooks()

QList< LinkedNotebook > quentier::LocalStorageManager::listLinkedNotebooks ( const ListObjectsOptions  flag,
ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListLinkedNotebooksOrder  order = ListLinkedNotebooksOrder::NoOrder,
const OrderDirection  orderDirection = OrderDirection::Ascending 
) const

listLinkedNotebooks attempts to list linked notebooks within the account according to the specified input flag.

Parameters
flagInput parameter used to set the filter for the desired linked notebooks to be listed
errorDescriptionError description if linked notebooks within the account could not be listed; if no error happens, this parameter is untouched
limitLimit for the max number of linked notebooks in the result, zero by default which means no limit is set
offsetNumber of linked notebooks to skip in the beginning of the result, zero by default
orderAllows to specify particular ordering of linked notebooks in the result, NoOrder by default
orderDirectionSpecifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder
Returns
Either list of linked notebooks within the account conforming to the filter or empty list in cases of error or no linked notebooks conforming to the filter exist within the account

◆ listNotebooks()

QList< Notebook > quentier::LocalStorageManager::listNotebooks ( const ListObjectsOptions  flag,
ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListNotebooksOrder  order = ListNotebooksOrder::NoOrder,
const OrderDirection  orderDirection = OrderDirection::Ascending,
const QString &  linkedNotebookGuid = QString() 
) const

listNotebooks attempts to list notebooks within the account according to the specified input flag

Parameters
flagInput parameter used to set the filter for the desired notebooks to be listed
errorDescriptionError description if notebooks within the account could not be listed; if no error happens, this parameter is untouched
limitThe limit for the max number of notebooks in the result, zero by default which means no limit is set
offsetThe number of notebooks to skip in the beginning of the result, zero by default
orderAllows to specify a particular ordering of notebooks in the result, NoOrder by default
orderDirectionSpecifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder
linkedNotebookGuidIf it's null, the method would list notebooks ignoring their belonging to the current account or to some linked notebook; if it's empty, only the non-linked notebooks would be listed; otherwise, the only one notebook from the corresponding linked notebook would be listed
Returns
Either the list of notebooks within the account conforming to the filter or empty list in cases of error or no notebooks conforming to the filter exist within the account

◆ listNotes()

QList< Note > quentier::LocalStorageManager::listNotes ( const ListObjectsOptions  flag,
const GetNoteOptions  options,
ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListNotesOrder  order = ListNotesOrder::NoOrder,
const OrderDirection  orderDirection = OrderDirection::Ascending,
const QString &  linkedNotebookGuid = QString() 
) const

listNotes attempts to list notes within the account according to the specified input flag.

Parameters
flagInput parameter used to set the filter for the desired notes to be listed
optionsOptions specifying which optionally includable fields of the note should actually be included
errorDescriptionError description if notes within the account could not be listed; if no error happens, this parameter is untouched
limitLimit for the max number of notes in the result, zero by default which means no limit is set
offsetNumber of notes to skip in the beginning of the result, zero by default
orderAllows to specify particular ordering of notes in the result, NoOrder by default
orderDirectionSpecifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder
linkedNotebookGuidIf it's null, notes from both user's own notebooks and linked notebooks would be listed; if it's empty, only the notes from non-linked notebooks would be listed; otherwise, only the notes from the specified linked notebook would be listed
Returns
Either list of notes within the account conforming to the filter or empty list in cases of error or no notes conforming to the filter exist within the account

◆ listNotesByLocalUids()

QList< Note > quentier::LocalStorageManager::listNotesByLocalUids ( const QStringList &  noteLocalUids,
const GetNoteOptions  options,
ErrorString errorDescription,
const ListObjectsOptions &  flag = ListObjectsOption::ListAll,
const size_t  limit = 0,
const size_t  offset = 0,
const ListNotesOrder order = ListNotesOrder::NoOrder,
const OrderDirection orderDirection = OrderDirection::Ascending 
) const

listNotesByLocalUids attempts to list notes given their local uids

The method would only return notes which it managed to find within the local storage i.e. having an invalid local uid in the list won't result in an error, just in the corresponding note not returned within the result

Notes within the result can be additionally filtered with flag parameter

Parameters
noteLocalUidsLocal uids of notes to be listed
optionsOptions specifying which optionally includable fields of the note should actually be included
errorDescriptionError description in case notes could not be listed
flagInput parameter used to set the filter for the desired notes to be listed
limitLimit for the max number of notes in the result, zero by default which means no limit is set
offsetNumber of notes to skip in the beginning of the result, zero by default
orderAllows to specify particular ordering of notes in the result, NoOrder by default
orderDirectionSpecifies the direction of ordering, by default ascending direction is used;
Returns
Either list of notes by local uids or empty list in case of error or no notes corresponding to given local uids presence

◆ listNotesPerNotebook()

QList< Note > quentier::LocalStorageManager::listNotesPerNotebook ( const Notebook notebook,
const GetNoteOptions  options,
ErrorString errorDescription,
const ListObjectsOptions &  flag = ListObjectsOption::ListAll,
const size_t  limit = 0,
const size_t  offset = 0,
const ListNotesOrder order = ListNotesOrder::NoOrder,
const OrderDirection orderDirection = OrderDirection::Ascending 
) const

listNotesPerNotebook attempts to list notes per given notebook

Parameters
notebookNotebook for which the list of notes is requested. If it has the "remote" Evernote service's guid set, it would be used to identify the notebook in the local storage database, otherwise its local uid would be used
optionsOptions specifying which optionally includable fields of the note should actually be included
errorDescriptionError description in case notes could not be listed
flagInput parameter used to set the filter for the desired notes to be listed
limitLimit for the max number of notes in the result, zero by default which means no limit is set
offsetNumber of notes to skip in the beginning of the result, zero by default
orderAllows to specify particular ordering of notes in the result, NoOrder by default
orderDirectionSpecifies the direction of ordering, by default ascending direction is used;
Returns
Either list of notes per notebook or empty list in case of error or no notes presence in the given notebook

◆ listNotesPerNotebooksAndTags()

QList< Note > quentier::LocalStorageManager::listNotesPerNotebooksAndTags ( const QStringList &  notebookLocalUids,
const QStringList &  tagLocalUids,
const GetNoteOptions  options,
ErrorString errorDescription,
const ListObjectsOptions &  flag = ListObjectsOption::ListAll,
const size_t  limit = 0,
const size_t  offset = 0,
const ListNotesOrder order = ListNotesOrder::NoOrder,
const OrderDirection orderDirection = OrderDirection::Ascending 
) const

listNotesPerNotebooksAndTags attempts to list notes which are present within one of specified notebooks and are labeled with at least one of specified tags

Parameters
notebookLocalUidsLocal uids of notebooks to which the listed notes might belong
tagLocalUidsLocal uids of tags with which the listed notes might be labeled
optionsOptions specifying which optionally includable fields of the note should actually be included
errorDescriptionError description in case notes could not be listed
flagInput parameter used to set the filter for the desired notes to be listed
limitLimit for the max number of notes in the result, zero by default which means no limit is set
offsetNumber of notes to skip in the beginning of the result, zero by default
orderAllows to specify particular ordering of notes in the result, NoOrder by default
orderDirectionSpecifies the direction of ordering, by default ascending direction is used;
Returns
Either list of notes per notebooks and tags or empty list in case of error or no notes corresponding to given notebooks and tags presence

◆ listNotesPerTag()

QList< Note > quentier::LocalStorageManager::listNotesPerTag ( const Tag tag,
const GetNoteOptions  options,
ErrorString errorDescription,
const ListObjectsOptions &  flag = ListObjectsOption::ListAll,
const size_t  limit = 0,
const size_t  offset = 0,
const ListNotesOrder order = ListNotesOrder::NoOrder,
const OrderDirection orderDirection = OrderDirection::Ascending 
) const

listNotesPerTag attempts to list notes labeled with a given tag

Parameters
tagTag for which the list of notes labeled with it is requested. If it has the "remote" Evernote service's guid set, it is used to identify the tag in the local storage database, otherwise its local uid is used
optionsOptions specifying which optionally includable fields of the note should actually be included
errorDescriptionError description in case notes could not be listed
flagInput parameter used to set the filter for the desired notes to be listed
limitLimit for the max number of notes in the result, zero by default which means no limit is set
offsetNumber of notes to skip in the beginning of the result, zero by default
orderAllows to specify particular ordering of notes in the result, NoOrder by default
orderDirectionSpecifies the direction of ordering, by default ascending direction is used;
Returns
Either list of notes per tag or empty list in case of error or no notes labeled with the given tag presence

◆ listSavedSearches()

QList< SavedSearch > quentier::LocalStorageManager::listSavedSearches ( const ListObjectsOptions  flag,
ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListSavedSearchesOrder  order = ListSavedSearchesOrder::NoOrder,
const OrderDirection  orderDirection = OrderDirection::Ascending 
) const

listSavedSearches attempts to list saved searches within the account according to the specified input flag.

Parameters
flagInput parameter used to set the filter for the desired saved searches to be listed
errorDescriptionError description if saved searches within the account could not be listed; if no error happens, this parameter is untouched
limitLimit for the max number of saved searches in the result, zero by default which means no limit is set
offsetNumber of saved searches to skip in the beginning of the result, zero by default
orderAllows to specify particular ordering of saved searches in the result, NoOrder by default
orderDirectionSpecifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder
Returns
Either list of saved searches within the account conforming to the filter or empty list in cases of error or no saved searches conforming to the filter exist within the account

◆ listSharedNotebooksPerNotebookGuid()

QList< SharedNotebook > quentier::LocalStorageManager::listSharedNotebooksPerNotebookGuid ( const QString &  notebookGuid,
ErrorString errorDescription 
) const

listSharedNotebooksPerNotebookGuid - attempts to list all shared notebooks per given notebook's remote guid (not local uid, it's important).

Parameters
notebookGuidRemote Evernote service's guid of the notebook for which the shared notebooks are requested
errorDescriptionError description if shared notebooks per notebook guid could not be listed; if no error happens, this parameter is untouched
Returns
Either the list of shared notebooks per notebook guid or empty list in case of error or no shared notebooks presence per given notebook guid

◆ listTags()

QList< Tag > quentier::LocalStorageManager::listTags ( const ListObjectsOptions  flag,
ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListTagsOrder order = ListTagsOrder::NoOrder,
const OrderDirection  orderDirection = OrderDirection::Ascending,
const QString &  linkedNotebookGuid = QString() 
) const

listTags attempts to list tags within the account according to the specified input flag.

Parameters
flagInput parameter used to set the filter for the desired tags to be listed
errorDescriptionError description if notes within the account could not be listed; if no error happens, this parameter is untouched
limitLimit for the max number of tags in the result, zero by default which means no limit is set
offsetNumber of tags to skip in the beginning of the result, zero by default
orderAllows to specify particular ordering of tags in the result, NoOrder by default
orderDirectionSpecifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder
linkedNotebookGuidIf it's null, the method would list tags ignoring their belonging to the current account or to some linked notebook; if it's empty, only the tags from user's own account would be listed; otherwise, only the tags corresponding to the certain linked notebook would be listed
Returns
Either list of tags within the account conforming to the filter or empty list in cases of error or no tags conforming to the filter exist within the account

◆ listTagsWithNoteLocalUids()

QList< std::pair< Tag, QStringList > > quentier::LocalStorageManager::listTagsWithNoteLocalUids ( const ListObjectsOptions  flag,
ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListTagsOrder order = ListTagsOrder::NoOrder,
const OrderDirection  orderDirection = OrderDirection::Ascending,
const QString &  linkedNotebookGuid = QString() 
) const

listTagsWithNoteLocalUids attempts to list tags and their corresponding local uids within the account according to the specified input flag

The method is very similar to listTags only for each listed tag it returns the list of note local uids corresponding to notes labeled with the respective tag.

Parameters
flagInput parameter used to set the filter for the desired tags to be listed
errorDescriptionError description if notes within the account could not be listed; if no error happens, this parameter is untouched
limitLimit for the max number of tags in the result, zero by default which means no limit is set
offsetNumber of tags to skip in the beginning of the result, zero by default
orderAllows to specify particular ordering of tags in the result, NoOrder by default
orderDirectionSpecifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder
linkedNotebookGuidIf it's null, the method would list tags ignoring their belonging to the current account or to some linked notebook; if it's empty, only the tags from user's own account would be listed; otherwise, only the tags corresponding to the certain linked notebook would be listed
Returns
Either list of tags and note local uids within the account conforming to the filter or empty list in cases of error or no tags conforming to the filter exist within the account

◆ localStorageRequiresUpgrade()

bool quentier::LocalStorageManager::localStorageRequiresUpgrade ( ErrorString errorDescription)

localStorageRequiresUpgrade method checks whether the existing local storage persistence requires to be upgraded. The upgrades may be required sometimes when new version of libquentier is rolled out which changes something in the internals of local storage organization. This method only checks for changes which are backwards incompatible i.e. once the local storage is upgraded, previous version of libquentier won't be able to work with it properly!

NOTE: it is libquentier client code's responsibility to call this method and/or isLocalStorageVersionTooHigh method, libquentier won't call any of these on its own and will just attempt to work with the existing local storage, whatever version it is of. If version is too high, things can fail in most mysterious way, so the client code is obliged to call these methods to ensure the local storage version is checked properly.

Parameters
errorDescriptionTextual description of the error if the method was unable to determine whether the local storage requires upgrade, otherwise this parameter is not touched by the method
Returns
True if local storage requires upgrade, false otherwise

◆ localStorageVersion()

qint32 quentier::LocalStorageManager::localStorageVersion ( ErrorString errorDescription)

localStorageVersion method fetches the current version of local storage persistence which can be used for informational purposes.

Parameters
errorDescriptionTextual description of the error if the method was unable to determine the current version of local storage persistence
Returns
Positive number indication local storage version or negative number in case of error retrieving the local storage version

◆ notebookCount()

int quentier::LocalStorageManager::notebookCount ( ErrorString errorDescription) const

notebookCount returns the number of notebooks currently stored in the local storage database

Parameters
errorDescriptionError description if the number of notebooks could not be returned
Returns
Either non-negative value with the number of notebooks or -1 which means some error has occurred

◆ noteCount()

int quentier::LocalStorageManager::noteCount ( ErrorString errorDescription,
const NoteCountOptions  options = NoteCountOption::IncludeNonDeletedNotes 
) const

noteCount returns the number of notes currently stored in the local storage database.

Parameters
errorDescriptionError description if the number of notes could not be returned
optionsOptions clarifying which notes to list; by default only non-deleted notes are listed
Returns
Either non-negative value with the number of notes or -1 which means some error occurred

◆ noteCountPerNotebook()

int quentier::LocalStorageManager::noteCountPerNotebook ( const Notebook notebook,
ErrorString errorDescription,
const NoteCountOptions  options = NoteCountOption::IncludeNonDeletedNotes 
) const

noteCountPerNotebook returns the number of notes currently stored in the local storage database per given notebook.

Parameters
notebookNotebook for which the number of notes is requested. If its guid is set, it is used to identify the notebook, otherwise its local uid is used
errorDescriptionError description if the number of notes per given notebook could not be returned
optionsOptions clarifying which notes to list; by default only non-deleted notes are listed
Returns
Either non-negative value with the number of notes per given notebook or -1 which means some error occurred

◆ noteCountPerNotebooksAndTags()

int quentier::LocalStorageManager::noteCountPerNotebooksAndTags ( const QStringList &  notebookLocalUids,
const QStringList &  tagLocalUids,
ErrorString errorDescription,
const NoteCountOptions  options = NoteCountOption::IncludeNonDeletedNotes 
) const

noteCountPerNotebooksAndTags returns the number of notes currently stored in local storage database belonging to one of notebooks corresponding to given notebook local uids and labeled by at least one of tags corresponding to given tag local uids

Parameters
notebookLocalUidsThe list of notebook local uids used for filtering
tagLocalUidsThe list of tag local uids used for filtering
errorDescriptionError description if the number of notes per notebooks and tags could not be returned
optionsOptions clarifying which notes to list; by default only non-deleted notes are listed
Returns
Either non-negative value with the number of notes per given tag or -1 which means some error occurred

◆ noteCountPerTag()

int quentier::LocalStorageManager::noteCountPerTag ( const Tag tag,
ErrorString errorDescription,
const NoteCountOptions  options = NoteCountOption::IncludeNonDeletedNotes 
) const

noteCountPerTag returns the number of notes currently stored in local storage database labeled with given tag.

Parameters
tagTag for which the number of notes labeled with it is requested. If its guid is set, it is used to identify the tag, otherwise its local uid is used
errorDescriptionError description if the number of notes per given tag could not be returned
optionsOptions clarifying which notes to list; by default only non-deleted notes are listed
Returns
Either non-negative value with the number of notes per given tag or -1 which means some error occurred

◆ noteCountsPerAllTags()

bool quentier::LocalStorageManager::noteCountsPerAllTags ( QHash< QString, int > &  noteCountsPerTagLocalUid,
ErrorString errorDescription,
const NoteCountOptions  options = NoteCountOption::IncludeNonDeletedNotes 
) const

noteCountsPerAllTags returns the number of notes currently stored in local storage database labeled with each tag stored in the local storage database.

Parameters
noteCountsPerTagLocalUidThe result hash: note counts by tag local uids
errorDescriptionError description if the number of notes per all tags could not be returned
optionsOptions clarifying which notes to list; by default only non-deleted notes are listed
Returns
True if note counts for all tags were computed successfully, false otherwise

◆ requiredLocalStoragePatches()

QVector< std::shared_ptr< ILocalStoragePatch > > quentier::LocalStorageManager::requiredLocalStoragePatches ( )

requiredLocalStoragePatches provides the client code with the list of patches which need to be applied to the current state of local storage in order to bring it to a state compatible with the current version of code. If no patches are required, an empty list of patches is returned.

The client code should apply each patch in the exact order in which they are returned by this method.

Returns
The vector of patches required to be applied to the current local storage version

◆ savedSearchCount()

int quentier::LocalStorageManager::savedSearchCount ( ErrorString errorDescription) const

savedSearchCount returns the number of saved seacrhes currently stored in local storage database.

Parameters
errorDescriptionError description if the number of saved seacrhes could not be returned
Returns
Either non-negative value with the number of saved seacrhes or -1 which means some error occurred

◆ switchUser()

void quentier::LocalStorageManager::switchUser ( const Account account,
const StartupOptions  options = {} 
)

switchUser - switches to another local storage database file associated with the passed in account

If optional "startFromScratch" parameter is set to true (it is false by default), the database file would be erased and only then - opened. If optional "overrideLock" parameter is set to true, the advisory lock set on the database file (if any) would be forcefully removed; otherwise, if this parameter if set to false, the presence of advisory lock on the database file woud cause the method to throw DatabaseLockedException

Parameters
accountThe account to which the local storage is to be switched
optionsStartup options for the local storage, none enabled by default

◆ tagCount()

int quentier::LocalStorageManager::tagCount ( ErrorString errorDescription) const

tagCount returns the number of non-deleted tags currently stored in the local storage database.

Parameters
errorDescriptionError description if the number of tags could not be returned
Returns
Either non-negative value with the number of tags or -1 which means some error occurred

◆ updateEnResource()

bool quentier::LocalStorageManager::updateEnResource ( Resource resource,
ErrorString errorDescription 
)

updateEnResource updates passed in resource in the local storage database.

If the resource has "remote" Evernote service's guid set, it is identified by this guid in the local storage database. If no resource with such guid is found, the local uid is used to identify the resource in the local storage database. If the resource has no guid, the local uid is used to identify it in the local storage database.

Parameters
resourceResource to be updated; may be changed as a result of the call, automatically filled with local uid and note local uid and/or guid if these were empty before the call
errorDescriptionError description if resource could not be updated
Returns
True if resource was updated successfully, false otherwise

◆ updateLinkedNotebook()

bool quentier::LocalStorageManager::updateLinkedNotebook ( const LinkedNotebook linkedNotebook,
ErrorString errorDescription 
)

updateLinkedNotebook updates passd in LinkedNotebook in the local storage database; LinkedNotebook must have "remote" Evernote service's guid set.

Parameters
linkedNotebookLinkedNotebook to be updated in the local storage database
errorDescriptionError description if linked notebook could not be updated
Returns
True if linked notebook was updated successfully, false otherwise

◆ updateNote()

bool quentier::LocalStorageManager::updateNote ( Note note,
const UpdateNoteOptions  options,
ErrorString errorDescription 
)

updateNote updates passed in Note in the local storage database.

If the note has "remote" Evernote service's guid set, it is identified by this guid in the local storage database. If no note with such guid is found, the local uid is used to identify the note in the local storage database. If the note has no guid, the local uid is used to identify it in the local storage database.

A special way in which this method might be used is the update of a note which clears note's guid. This way is special because it imposes certain requirements onto the resources which the note might have. However, it is only relevant if options input parameter has UpdateResourceMetadata flag enabled. The requirements for this special case are as follows:

  • each resource should not have noteGuid field set to a non-empty value
  • each resource should not have guid field set to a non-empty value as it makes no sense for note without guid i.e. note not synchronized with Evernote to own a resource which has guid i.e. is synchronized with Evernote
Parameters
noteNote to be updated in the local storage database; required to contain either "remote" notebook guid or local notebook uid; may be changed as a result of the call, filled with fields like local uid or notebook guid or local uid if any of these were empty before the call; also tag guids are filled if the note passed in contained only tag local uids and tag local uids are filled if the note passed in contained only tag guids. Bear in mind that after the call the note may not have the representative resources if "updateNoteOptions" input parameter contained no "UpdateResourceMetadata" flag as well as it may not have the representative tags if "UpdateTags" flag was not set
optionsOptions specifying which optionally updatable fields of the note should actually be updated
errorDescriptionError description if note could not be updated
Returns
True if note was updated successfully, false otherwise

◆ updateNotebook()

bool quentier::LocalStorageManager::updateNotebook ( Notebook notebook,
ErrorString errorDescription 
)

updateNotebook updates the passed in Notebook in the local storage database

If the notebook has "remote" Evernote service's guid set, it is identified by this guid in the local storage database. Otherwise it is identified by the local uid.

Parameters
notebookNotebook to be updated in the local storage database; the object is passed by reference and may be changed as a result of the call (filled with autocompleted fields like local uid if it was empty before the call)
errorDescriptionError description if the notebook could not be updated
Returns
True if the notebook was updated successfully, false otherwise

◆ updateSavedSearch()

bool quentier::LocalStorageManager::updateSavedSearch ( SavedSearch search,
ErrorString errorDescription 
)

updateSavedSearch updates passed in SavedSearch in the local storage database.

If search has "remote" Evernote service's guid set, it is identified in the database by this guid. If the saved search has no guid, the local uid is used to identify it in the local storage database.

Parameters
searchSavedSearch filled with values to be updated in the local storage database; may be changed as a result of the call filled local uid if it was empty before the call
errorDescriptionError description if SavedSearch could not be updated
Returns
True if SavedSearch was updated successfully, false otherwise

◆ updateTag()

bool quentier::LocalStorageManager::updateTag ( Tag tag,
ErrorString errorDescription 
)

updateTag updates passed in Tag in the local storage database.

If the tag has "remote" Evernote service's guid set, it is identified by this guid in the local storage database. If the tag has no guid, the local uid is used to identify it in the local storage database.

Parameters
tagTag filled with values to be updated in the local storage database. Note that it can be changed * as a result of the call: automatically filled with local uid if it was empty before the call
errorDescriptionError description if tag could not be updated
Returns
True if tag was updated successfully, false otherwise

◆ updateUser()

bool quentier::LocalStorageManager::updateUser ( const User user,
ErrorString errorDescription 
)

updateUser updates the passed in User object in the local storage database

The table with Users is only involved in operations with notebooks which have "contact" field set which in turn is used with business accounts

Parameters
userThe user to be updated in the local storage database
errorDescriptionError description if the user could not be updated
Returns
True if the user was updated successfully, false otherwise

◆ upgradeProgress

void quentier::LocalStorageManager::upgradeProgress ( double  progress)
signal

LocalStorageManager is capable of performing automatic database upgrades if/when it is necessary.

As the database upgrade can be a lengthy operation, this signal is meant to provide some feedback on the progress of the upgrade

Parameters
progressThe value from 0 to 1 denoting the database upgrade progress

◆ userCount()

int quentier::LocalStorageManager::userCount ( ErrorString errorDescription) const

userCount returns the number of non-deleted users currently stored in the local storage database

Parameters
errorDescriptionError description if the number of users could not be returned
Returns
Either non-negative value with the number of users or -1 which means some error has occurred