From c4812607c9ce1b5b6795910afed2505a68d40e8f Mon Sep 17 00:00:00 2001 From: Oliver Ruebel Date: Tue, 3 Sep 2024 14:55:27 -0700 Subject: [PATCH] Remove NWBFile.identifierText property --- src/nwb/NWBFile.cpp | 17 ++++++++--------- src/nwb/NWBFile.hpp | 10 ++++++---- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/nwb/NWBFile.cpp b/src/nwb/NWBFile.cpp index 4a79b4a9..bc27df59 100644 --- a/src/nwb/NWBFile.cpp +++ b/src/nwb/NWBFile.cpp @@ -34,23 +34,17 @@ NWBFile::NWBFile(std::shared_ptr io) NWBFile::~NWBFile() {} -Status NWBFile::initialize(const std::string& idText) +Status NWBFile::initialize(const std::string& identifierText) { - this->identifierText = idText; if (std::filesystem::exists(io->getFileName())) { return io->open(false); } else { io->open(true); - return createFileStructure(); + return createFileStructure(identifierText); } } -Status NWBFile::finalize() -{ - return io->close(); -} - -Status NWBFile::createFileStructure() +Status NWBFile::createFileStructure(const std::string& identifierText) { if (!io->canModifyObjects()) { return Status::Failure; @@ -92,6 +86,11 @@ Status NWBFile::createFileStructure() return Status::Success; } +Status NWBFile::finalize() +{ + return io->close(); +} + Status NWBFile::createElectricalSeries( std::vector recordingArrays, const BaseDataType& dataType, diff --git a/src/nwb/NWBFile.hpp b/src/nwb/NWBFile.hpp index 0488435a..fa28ae85 100644 --- a/src/nwb/NWBFile.hpp +++ b/src/nwb/NWBFile.hpp @@ -51,9 +51,9 @@ class NWBFile : public Container * @brief Initializes the NWB file by opening and setting up the file * structure. * - * @param idText The identifier text for the NWBFile. + * @param identifierText The identifier text for the NWBFile. */ - Status initialize(const std::string& idText); + Status initialize(const std::string& identifierText); /** * @brief Finalizes the NWB file by closing it. @@ -87,9 +87,12 @@ class NWBFile : public Container * Note, this function will fail if the file is in a mode where * new objects cannot be added, which can be checked via * nwbfile.io->canModifyObjects() + * + * @param identifierText The identifier text for the NWBFile. + * * @return Status The status of the file structure creation. */ - Status createFileStructure(); + Status createFileStructure(const std::string& identifierText); private: /** @@ -122,7 +125,6 @@ class NWBFile : public Container const std::array, N>& specVariables); - std::string identifierText; // TODO Remove this for read static std::vector emptyContainerIndexes; };