47 lines
1.0 KiB
C
47 lines
1.0 KiB
C
#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);
|
|
}
|
|
}
|