aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2019-09-16 01:16:37 +0300
committerCrystalwarrior <varsash@gmail.com>2019-09-16 01:16:37 +0300
commitbf999f195a0be20519356644df1940cf18d905e7 (patch)
tree15c9bc9220ef38147578ceaab0dd164685fdc468 /include
parent1b36be9dbc0cc665ddb69e1e1ee70267612b5d6c (diff)
Add file reading, writing and appending functions that create folders if bool is true
Fix server_address not being properly created in packet distribution Create a log file when you join a server in the logs/<server name>/<logname>.log and update it every time there's a new chat entry minor refactor of chatlogpiece
Diffstat (limited to 'include')
-rw-r--r--include/aoapplication.h12
-rw-r--r--include/chatlogpiece.h4
2 files changed, 14 insertions, 2 deletions
diff --git a/include/aoapplication.h b/include/aoapplication.h
index e63ab8e7..24dc35ce 100644
--- a/include/aoapplication.h
+++ b/include/aoapplication.h
@@ -201,6 +201,15 @@ public:
//Returns the list of words in callwords.ini
QStringList get_call_words();
+ //Process a file and return its text as a QString
+ QString read_file(QString filename);
+
+ //Write text to file. make_dir would auto-create the directory if it doesn't exist.
+ bool write_to_file(QString p_text, QString p_file, bool make_dir = false);
+
+ //Append text to the end of the file. make_dir would auto-create the directory if it doesn't exist.
+ bool append_to_file(QString p_text, QString p_file, bool make_dir = false);
+
//Appends the argument string to serverlist.txt
void write_to_serverlist_txt(QString p_line);
@@ -337,6 +346,9 @@ public:
// Get the message for the CM for casing alerts.
QString get_casing_can_host_cases();
+ //The file name of the log file in base/logs.
+ QString log_filename;
+
private:
const int RELEASE = 2;
const int MAJOR_VERSION = 6;
diff --git a/include/chatlogpiece.h b/include/chatlogpiece.h
index 34c5926b..303c2351 100644
--- a/include/chatlogpiece.h
+++ b/include/chatlogpiece.h
@@ -14,7 +14,7 @@ public:
QString get_name();
QString get_showname();
QString get_message();
- bool get_is_song();
+ bool is_song();
QDateTime get_datetime();
QString get_datetime_as_string();
@@ -25,7 +25,7 @@ private:
QString showname;
QString message;
QDateTime datetime;
- bool is_song;
+ bool p_is_song;
};
#endif // CHATLOGPIECE_H