source: SMSSender/lib/libgateway/src/persistence/AbstractLoginAccountStorageOfficer.cpp @ 41:680c6a482e9d

3.0
Last change on this file since 41:680c6a482e9d was 41:680c6a482e9d, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
File size: 887 bytes
Line 
1#include "AbstractLoginAccountStorageOfficer.h"
2
3
4void AbstractLoginAccountStorageOfficer::readFromStorage() {
5    AbstractAccountStorageOfficer::readFromStorage();
6
7    account()->setUsername(storage()->readString(getNamespace(), "username"));
8    account()->setPassword(storage()->readEncryptedString(getNamespace(), "password", ENCRYPTION_PWD));
9}
10
11void AbstractLoginAccountStorageOfficer::writeToStorage() const {
12    AbstractAccountStorageOfficer::writeToStorage();
13
14    storage()->writeString(getNamespace(), "username", account()->username());
15    storage()->writeEncryptedString(getNamespace(), "password", ENCRYPTION_PWD, account()->password());
16}
17
18
19ILoginAccount* AbstractLoginAccountStorageOfficer::account() const {
20    return reinterpret_cast<ILoginAccount*>(AbstractAccountStorageOfficer::account()); // has to be a reinterpret_cast, since IAccount is included virtually
21}
Note: See TracBrowser for help on using the repository browser.