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
application/file_manager.hpp@3:998f7fb862af, 2016-12-09 (annotated)
- Committer:
- micbio
- Date:
- Fri Dec 09 11:22:47 2016 +0000
- Revision:
- 3:998f7fb862af
dupa
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
micbio | 3:998f7fb862af | 1 | #include "mbed.h" |
micbio | 3:998f7fb862af | 2 | #include <string> |
micbio | 3:998f7fb862af | 3 | |
micbio | 3:998f7fb862af | 4 | #define MAX_TEXT_LEN 400 |
micbio | 3:998f7fb862af | 5 | |
micbio | 3:998f7fb862af | 6 | |
micbio | 3:998f7fb862af | 7 | class file_manager |
micbio | 3:998f7fb862af | 8 | { |
micbio | 3:998f7fb862af | 9 | private: |
micbio | 3:998f7fb862af | 10 | FILE *fp; |
micbio | 3:998f7fb862af | 11 | char * path_sisk; |
micbio | 3:998f7fb862af | 12 | char * path_agh; |
micbio | 3:998f7fb862af | 13 | char * path_krk; |
micbio | 3:998f7fb862af | 14 | char * current_path; |
micbio | 3:998f7fb862af | 15 | char buffer[MAX_TEXT_LEN]; |
micbio | 3:998f7fb862af | 16 | |
micbio | 3:998f7fb862af | 17 | void print_files(void); |
micbio | 3:998f7fb862af | 18 | void get_string(void); |
micbio | 3:998f7fb862af | 19 | bool open_file(char option); |
micbio | 3:998f7fb862af | 20 | bool close_file(void); |
micbio | 3:998f7fb862af | 21 | void get_text(void); |
micbio | 3:998f7fb862af | 22 | |
micbio | 3:998f7fb862af | 23 | public: |
micbio | 3:998f7fb862af | 24 | file_manager(void) : |
micbio | 3:998f7fb862af | 25 | path_sisk("/sd/sisk.txt"), |
micbio | 3:998f7fb862af | 26 | path_agh("/sd/agh.txt"), |
micbio | 3:998f7fb862af | 27 | path_krk("/sd/krakow.txt"), |
micbio | 3:998f7fb862af | 28 | current_path(path_sisk) |
micbio | 3:998f7fb862af | 29 | { |
micbio | 3:998f7fb862af | 30 | fp = NULL; |
micbio | 3:998f7fb862af | 31 | } |
micbio | 3:998f7fb862af | 32 | |
micbio | 3:998f7fb862af | 33 | void get_path(void); |
micbio | 3:998f7fb862af | 34 | void set_path(void); |
micbio | 3:998f7fb862af | 35 | void write_to_file(void); |
micbio | 3:998f7fb862af | 36 | void append_to_file(void); |
micbio | 3:998f7fb862af | 37 | void read_file(void); |
micbio | 3:998f7fb862af | 38 | }; |