1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-11-24 13:17:41 +00:00
Files
CLK/Storage/FileBundle/FileBundle.cpp
2025-11-21 21:53:53 -05:00

30 lines
769 B
C++

//
// FileBundle.cpp
// Clock Signal
//
// Created by Thomas Harte on 19/11/2025.
// Copyright © 2025 Thomas Harte. All rights reserved.
//
#include "FileBundle.hpp"
using namespace Storage::FileBundle;
LocalFSFileBundle::LocalFSFileBundle(const std::string &to_contain) {
const auto last_separator = to_contain.find_last_of("/\\");
if(last_separator == std::string::npos) {
key_file_ = to_contain;
} else {
base_path_ = to_contain.substr(0, last_separator + 1);
key_file_ = to_contain.substr(last_separator + 1);
}
}
std::optional<std::string> LocalFSFileBundle::key_file() {
return key_file_;
}
Storage::FileHolder LocalFSFileBundle::open(const std::string &name, Storage::FileMode mode) {
return Storage::FileHolder(base_path_ + name, mode);
}