added copytron filemanager and working on flipper

This commit is contained in:
2025-03-25 07:34:15 -07:00
parent 51574fbc0b
commit 2a13827e87
11 changed files with 135 additions and 1 deletions

46
source/filemanager.c Normal file
View 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);
}
}