summaryrefslogtreecommitdiff
path: root/project.cpp
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2024-01-29 14:11:37 -0500
committerJosh Ferrell <josh@vector35.com>2024-01-29 14:11:37 -0500
commit172511fabc0c94d249a52f6bc117772d91e438ae (patch)
tree293dfa08d83f02e2230d2967a65a0e35134dd23b /project.cpp
parent0b68ffedb6ded3e5e90f39206d57bd1e93065c87 (diff)
Add creation timestamp to ProjectFile
Diffstat (limited to 'project.cpp')
-rw-r--r--project.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/project.cpp b/project.cpp
index b456d66c..f6e6b49c 100644
--- a/project.cpp
+++ b/project.cpp
@@ -418,11 +418,11 @@ Ref<ProjectFile> Project::CreateFileFromPath(const std::string& path, Ref<Projec
}
-Ref<ProjectFile> Project::CreateFileFromPathUnsafe(const std::string& path, Ref<ProjectFolder> folder, const std::string& name, const std::string& description,const std::string& id, const std::function<bool(size_t progress, size_t total)>& progressCallback)
+Ref<ProjectFile> Project::CreateFileFromPathUnsafe(const std::string& path, Ref<ProjectFolder> folder, const std::string& name, const std::string& description, const std::string& id, int64_t creationTimestamp, const std::function<bool(size_t progress, size_t total)>& progressCallback)
{
ProgressContext cb;
cb.callback = progressCallback;
- BNProjectFile* file = BNProjectCreateFileFromPathUnsafe(m_object, path.c_str(), folder ? folder->m_object : nullptr, name.c_str(), description.c_str(), id.c_str(), &cb, ProgressCallback);
+ BNProjectFile* file = BNProjectCreateFileFromPathUnsafe(m_object, path.c_str(), folder ? folder->m_object : nullptr, name.c_str(), description.c_str(), id.c_str(), creationTimestamp, &cb, ProgressCallback);
if (file == nullptr)
return nullptr;
return new ProjectFile(file);
@@ -440,11 +440,11 @@ Ref<ProjectFile> Project::CreateFile(const std::vector<uint8_t>& contents, Ref<P
}
-Ref<ProjectFile> Project::CreateFileUnsafe(const std::vector<uint8_t>& contents, Ref<ProjectFolder> folder, const std::string& name, const std::string& description,const std::string& id, const std::function<bool(size_t progress, size_t total)>& progressCallback)
+Ref<ProjectFile> Project::CreateFileUnsafe(const std::vector<uint8_t>& contents, Ref<ProjectFolder> folder, const std::string& name, const std::string& description, const std::string& id, int64_t creationTimestamp, const std::function<bool(size_t progress, size_t total)>& progressCallback)
{
ProgressContext cb;
cb.callback = progressCallback;
- BNProjectFile* file = BNProjectCreateFileUnsafe(m_object, contents.data(), contents.size(), folder ? folder->m_object : nullptr, name.c_str(), description.c_str(), id.c_str(), &cb, ProgressCallback);
+ BNProjectFile* file = BNProjectCreateFileUnsafe(m_object, contents.data(), contents.size(), folder ? folder->m_object : nullptr, name.c_str(), description.c_str(), id.c_str(), creationTimestamp, &cb, ProgressCallback);
if (file == nullptr)
return nullptr;
return new ProjectFile(file);
@@ -609,6 +609,12 @@ bool ProjectFile::Export(const std::string& destination) const
}
+int64_t ProjectFile::GetCreationTimestamp() const
+{
+ return BNProjectFileGetCreationTimestamp(m_object);
+}
+
+
ProjectFolder::ProjectFolder(BNProjectFolder* folder)
{
m_object = folder;