added copytron filemanager and working on flipper
This commit is contained in:
46
source/filemanager.c
Normal file
46
source/filemanager.c
Normal file
@@ -0,0 +1,46 @@
|
||||
#include "filemanager.h"
|
||||
#include <string.h>
|
||||
|
||||
const char* m_destenation;
|
||||
const char* m_workingDirectory;
|
||||
copytron_flips* m_flips;
|
||||
|
||||
|
||||
void SetCurrentDestenation(const char* des) {
|
||||
m_destenation = des;
|
||||
}
|
||||
|
||||
void SetCurrentWorkingDirectory(const char* workingDir) {
|
||||
m_workingDirectory = workingDir;
|
||||
}
|
||||
|
||||
const char* GetCurrentWorkingDriectory() {
|
||||
return m_workingDirectory;
|
||||
}
|
||||
|
||||
const char* GetCurrentDestenation() {
|
||||
return m_destenation;
|
||||
}
|
||||
|
||||
void SetCopytronFliper(copytron_flips *flips) {
|
||||
m_flips = flips;
|
||||
}
|
||||
|
||||
void AddDirectory(const char * dir) {
|
||||
if(strlen(dir) < 256) {
|
||||
copytron_file file = copytronFileCreate();
|
||||
strcpy(file.path, dir);
|
||||
file.path[strlen(file.path)] = '*';
|
||||
file.file_path_len = strlen(file.path);
|
||||
copytronAdd(m_flips, &file);
|
||||
}
|
||||
}
|
||||
|
||||
void AddFile(const char* dir) {
|
||||
if(strlen(dir) < 256) {
|
||||
copytron_file file = copytronFileCreate();
|
||||
strcpy(file.path, dir);
|
||||
file.file_path_len = strlen(file.path);
|
||||
copytronAdd(m_flips, &file);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user