clean up header files
parent
2823b5410d
commit
7c7164ea0c
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
const string LOG_PATH = "/mnt/ext1/system/config/nextcloud";
|
||||
const std::string LOG_PATH = "/mnt/ext1/system/config/nextcloud";
|
||||
|
||||
class EventHandler
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ private:
|
|||
std::unique_ptr<LoginView> _loginView;
|
||||
MenuHandler _menu = MenuHandler("Nextcloud");
|
||||
Nextcloud _nextcloud = Nextcloud();
|
||||
string _tempPath;
|
||||
std::string _tempPath;
|
||||
|
||||
/**
|
||||
* Function needed to call C function, redirects to real function
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
using std::string;
|
||||
|
||||
class MenuHandler
|
||||
{
|
||||
public:
|
||||
|
@ -21,7 +19,7 @@ public:
|
|||
*
|
||||
* @param name name of the application
|
||||
*/
|
||||
MenuHandler(const string &name);
|
||||
MenuHandler(const std::string &name);
|
||||
|
||||
~MenuHandler();
|
||||
|
||||
|
|
|
@ -17,9 +17,6 @@
|
|||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
class ListView
|
||||
{
|
||||
public:
|
||||
|
@ -29,7 +26,7 @@ public:
|
|||
* @param ContentRect area of the screen where the list view is placed
|
||||
* @param Items items that shall be shown in the listview
|
||||
*/
|
||||
ListView(const irect *contentRect, const vector<Item> &items);
|
||||
ListView(const irect *contentRect, const std::vector<Item> &items);
|
||||
|
||||
~ListView();
|
||||
|
||||
|
@ -39,7 +36,7 @@ public:
|
|||
* @param headerText the text that shall be displayed in the header
|
||||
*
|
||||
*/
|
||||
void drawHeader(string headerText);
|
||||
void drawHeader(std::string headerText);
|
||||
|
||||
/**
|
||||
* Draws the footer including a page changer
|
||||
|
@ -81,8 +78,8 @@ private:
|
|||
int _footerFontHeight;
|
||||
int _entryFontHeight;
|
||||
const irect *_contentRect;
|
||||
std::unique_ptr<const vector<Item>> _items;
|
||||
vector<ListViewEntry> _entries;
|
||||
std::unique_ptr<const std::vector<Item>> _items;
|
||||
std::vector<ListViewEntry> _entries;
|
||||
ifont *_headerFont;
|
||||
ifont *_footerFont;
|
||||
ifont *_entryFont;
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
using std::string;
|
||||
|
||||
enum KeyboardTarget
|
||||
{
|
||||
IURL,
|
||||
|
@ -45,9 +43,9 @@ public:
|
|||
*/
|
||||
int logginClicked(int x, int y);
|
||||
|
||||
string getUsername() { return _username; };
|
||||
string getPassword() { return _password; };
|
||||
string getURL() { return _url; };
|
||||
std::string getUsername() { return _username; };
|
||||
std::string getPassword() { return _password; };
|
||||
std::string getURL() { return _url; };
|
||||
|
||||
private:
|
||||
static LoginView *_loginViewStatic;
|
||||
|
@ -59,10 +57,10 @@ private:
|
|||
irect _usernameButton;
|
||||
irect _passwordButton;
|
||||
KeyboardTarget _target;
|
||||
string _username;
|
||||
string _password;
|
||||
string _url;
|
||||
string _temp;
|
||||
std::string _username;
|
||||
std::string _password;
|
||||
std::string _url;
|
||||
std::string _temp;
|
||||
|
||||
/**
|
||||
* Functions needed to call C function, handles the keyboard
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
using std::string;
|
||||
|
||||
enum Itemtype
|
||||
{
|
||||
IFILE,
|
||||
|
@ -37,7 +35,7 @@ public:
|
|||
*
|
||||
* @param xmlItem result of the nextcloud request
|
||||
*/
|
||||
Item(const string &xmlItem);
|
||||
Item(const std::string &xmlItem);
|
||||
|
||||
/**
|
||||
* Creates a new item by receiving localPath from the pocketbook
|
||||
|
@ -46,7 +44,7 @@ public:
|
|||
* @param state state of the file
|
||||
* @param type type of the item (folder/file)
|
||||
*/
|
||||
Item(const string &localPath, FileState state, Itemtype type);
|
||||
Item(const std::string &localPath, FileState state, Itemtype type);
|
||||
|
||||
/**
|
||||
* Tries to open the item by checking the file format and then executes the fitting action
|
||||
|
@ -55,36 +53,36 @@ public:
|
|||
|
||||
bool removeFile();
|
||||
|
||||
void setPath(const string &path) { _path = path; };
|
||||
string getPath() const { return _path; };
|
||||
void setPath(const std::string &path) { _path = path; };
|
||||
std::string getPath() const { return _path; };
|
||||
|
||||
string getLocalPath() const { return _localPath; };
|
||||
std::string getLocalPath() const { return _localPath; };
|
||||
|
||||
Itemtype getType() const { return _type; };
|
||||
|
||||
void setTitle(const string &title) { _title = title; };
|
||||
string getTitle() const { return _title; };
|
||||
void setTitle(const std::string &title) { _title = title; };
|
||||
std::string getTitle() const { return _title; };
|
||||
|
||||
void setState(FileState state) { _state = state; };
|
||||
FileState getState() const { return _state; };
|
||||
|
||||
string getLastEditDate() const { return _lastEditDate; };
|
||||
void setLastEditDate(const string &date) { _lastEditDate = date; };
|
||||
std::string getLastEditDate() const { return _lastEditDate; };
|
||||
void setLastEditDate(const std::string &date) { _lastEditDate = date; };
|
||||
|
||||
double getSize() const { return _size; };
|
||||
string getSizeString() const;
|
||||
std::string getSizeString() const;
|
||||
|
||||
string getFiletype() const { return _fileType; };
|
||||
std::string getFiletype() const { return _fileType; };
|
||||
|
||||
private:
|
||||
string _path;
|
||||
string _title;
|
||||
string _localPath;
|
||||
std::string _path;
|
||||
std::string _title;
|
||||
std::string _localPath;
|
||||
FileState _state{FileState::ICLOUD};
|
||||
Itemtype _type;
|
||||
string _lastEditDate{"Error"};
|
||||
std::string _lastEditDate{"Error"};
|
||||
double _size;
|
||||
string _fileType;
|
||||
std::string _fileType;
|
||||
|
||||
/**
|
||||
* Converts the size to an easier readble format
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include <string>
|
||||
#include <fstream>
|
||||
|
||||
void Log::writeLog(const string &text)
|
||||
void Log::writeLog(const std::string &text)
|
||||
{
|
||||
std::ofstream log(LOG_PATH + std::string("/logfile.txt"), std::ios_base::app | std::ios_base::out);
|
||||
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
using std::string;
|
||||
|
||||
class Log
|
||||
{
|
||||
public:
|
||||
|
@ -23,7 +21,7 @@ public:
|
|||
*
|
||||
* @param text that shall be written to the log
|
||||
*/
|
||||
static void writeLog(const string &text);
|
||||
static void writeLog(const std::string &text);
|
||||
|
||||
private:
|
||||
Log() {}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
using std::ifstream;
|
||||
using std::ofstream;
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
Nextcloud::Nextcloud()
|
||||
{
|
||||
|
|
|
@ -17,29 +17,26 @@
|
|||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
const string NEXTCLOUD_PATH = "/mnt/ext1/system/config/nextcloud";
|
||||
const string NEXTCLOUD_CONFIG_PATH = NEXTCLOUD_PATH + "/nextcloud.cfg";
|
||||
const string NEXTCLOUD_FILE_PATH = "/mnt/ext1/nextcloud";
|
||||
const string NEXTCLOUD_ROOT_PATH = "/remote.php/dav/files/";
|
||||
const string NEXTCLOUD_STRUCTURE_EXTENSION = ".structure";
|
||||
const string NEXTCLOUD_END_PATH = "/nextcloud";
|
||||
const std::string NEXTCLOUD_PATH = "/mnt/ext1/system/config/nextcloud";
|
||||
const std::string NEXTCLOUD_CONFIG_PATH = NEXTCLOUD_PATH + "/nextcloud.cfg";
|
||||
const std::string NEXTCLOUD_FILE_PATH = "/mnt/ext1/nextcloud";
|
||||
const std::string NEXTCLOUD_ROOT_PATH = "/remote.php/dav/files/";
|
||||
const std::string NEXTCLOUD_STRUCTURE_EXTENSION = ".structure";
|
||||
const std::string NEXTCLOUD_END_PATH = "/nextcloud";
|
||||
|
||||
class Nextcloud
|
||||
{
|
||||
public:
|
||||
explicit Nextcloud();
|
||||
|
||||
void setURL(const string &Url);
|
||||
void setUsername(const string &Username);
|
||||
void setUUID(const string &UUID);
|
||||
void setPassword(const string &Pass);
|
||||
void setStartFolder(const string &Path);
|
||||
bool setItems(const vector<Item> &tempItems);
|
||||
void setURL(const std::string &Url);
|
||||
void setUsername(const std::string &Username);
|
||||
void setUUID(const std::string &UUID);
|
||||
void setPassword(const std::string &Pass);
|
||||
void setStartFolder(const std::string &Path);
|
||||
bool setItems(const std::vector<Item> &tempItems);
|
||||
|
||||
const vector<Item> &getItems() const { return _items; };
|
||||
const std::vector<Item> &getItems() const { return _items; };
|
||||
bool isLoggedIn() const { return _loggedIn; };
|
||||
bool isWorkOffline() const { return _workOffline; };
|
||||
void switchWorkOffline() { _workOffline = !_workOffline; };
|
||||
|
@ -58,7 +55,7 @@ public:
|
|||
* @param Pass the pass of the Nextcloud instance
|
||||
* @return true - login succeeded, false - login failed
|
||||
*/
|
||||
bool login(const string &Url, const string &Username, const string &Pass);
|
||||
bool login(const std::string &Url, const std::string &Username, const std::string &Pass);
|
||||
|
||||
/**
|
||||
* Deletes the config files and deletes are temp files
|
||||
|
@ -71,14 +68,14 @@ public:
|
|||
* @param tempItems set of items where the item is in
|
||||
* @param itemID id of the item
|
||||
*/
|
||||
void downloadItem(vector<Item> &tempItems, int itemID);
|
||||
void downloadItem(std::vector<Item> &tempItems, int itemID);
|
||||
|
||||
/**
|
||||
* Downloads a certain folder from the Nextcloud and saves it locally
|
||||
* @param tempItems set of items where the item is in
|
||||
* @param itemID id of the item
|
||||
*/
|
||||
void downloadFolder(vector<Item> &tempItems, int itemId);
|
||||
void downloadFolder(std::vector<Item> &tempItems, int itemId);
|
||||
|
||||
/**
|
||||
* Checks the network connection and starts the download of the certain itemId
|
||||
|
@ -101,7 +98,7 @@ public:
|
|||
* @param pathUrl URL to get the dataStructure of
|
||||
* @return vector of items
|
||||
*/
|
||||
vector<Item> getDataStructure(string &pathUrl);
|
||||
std::vector<Item> getDataStructure(std::string &pathUrl);
|
||||
|
||||
/**
|
||||
* formats the pathUrl to a local path
|
||||
|
@ -109,7 +106,7 @@ public:
|
|||
* @param path online path
|
||||
* @return local path
|
||||
*/
|
||||
static string getLocalPath(string path);
|
||||
static std::string getLocalPath(std::string path);
|
||||
|
||||
/**
|
||||
* checks the local storage checks if the items are locally available
|
||||
|
@ -117,12 +114,12 @@ public:
|
|||
* @param tempItems items that shall be compared
|
||||
* @param localPath path that has to be checked
|
||||
*/
|
||||
void getLocalFileStructure(vector<Item> &tempItems, const string &localPath);
|
||||
void getLocalFileStructure(std::vector<Item> &tempItems, const std::string &localPath);
|
||||
|
||||
private:
|
||||
vector<Item> _items;
|
||||
std::vector<Item> _items;
|
||||
bool _loggedIn{false};
|
||||
string _url;
|
||||
std::string _url;
|
||||
bool _workOffline{false};
|
||||
|
||||
/**
|
||||
|
@ -133,13 +130,13 @@ private:
|
|||
* @param Pass the pass of the Nextcloud instance
|
||||
* @return vector of Items
|
||||
*/
|
||||
vector<Item> getDataStructure(const string &pathUrl, const string &Username, const string &Pass);
|
||||
std::vector<Item> getDataStructure(const std::string &pathUrl, const std::string &Username, const std::string &Pass);
|
||||
|
||||
string getUrl();
|
||||
string getUsername();
|
||||
string getUUID();
|
||||
string getPassword();
|
||||
string getStartFolder();
|
||||
std::string getUrl();
|
||||
std::string getUsername();
|
||||
std::string getUUID();
|
||||
std::string getPassword();
|
||||
std::string getStartFolder();
|
||||
|
||||
/**
|
||||
* Handles the end of the game dialog and lets the user
|
||||
|
@ -156,14 +153,14 @@ private:
|
|||
* @param xml xml formatted result from curl call
|
||||
* @return vector<Item> the items that have been read from the xml
|
||||
*/
|
||||
vector<Item> readInXML(string xml);
|
||||
std::vector<Item> readInXML(std::string xml);
|
||||
|
||||
/**
|
||||
* Checks if a .structure file exists and if that is the case return a vector of items
|
||||
* @param pathUrl path that shall be checked
|
||||
* @return return the items for the structure if available offline
|
||||
*/
|
||||
vector<Item> getOfflineStructure(const string &pathUrl);
|
||||
std::vector<Item> getOfflineStructure(const std::string &pathUrl);
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue