Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface SDFileSystem mbed-rtos mbed
Diff: application/file_manager.hpp
- Revision:
- 3:998f7fb862af
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/application/file_manager.hpp Fri Dec 09 11:22:47 2016 +0000
@@ -0,0 +1,38 @@
+#include "mbed.h"
+#include <string>
+
+#define MAX_TEXT_LEN 400
+
+
+class file_manager
+{
+private:
+ FILE *fp;
+ char * path_sisk;
+ char * path_agh;
+ char * path_krk;
+ char * current_path;
+ char buffer[MAX_TEXT_LEN];
+
+ void print_files(void);
+ void get_string(void);
+ bool open_file(char option);
+ bool close_file(void);
+ void get_text(void);
+
+public:
+ file_manager(void) :
+ path_sisk("/sd/sisk.txt"),
+ path_agh("/sd/agh.txt"),
+ path_krk("/sd/krakow.txt"),
+ current_path(path_sisk)
+ {
+ fp = NULL;
+ }
+
+ void get_path(void);
+ void set_path(void);
+ void write_to_file(void);
+ void append_to_file(void);
+ void read_file(void);
+};