Skip to content

Commit

Permalink
Remove NWBFile.identifierText property
Browse files Browse the repository at this point in the history
  • Loading branch information
oruebel committed Sep 3, 2024
1 parent 5c2faae commit c481260
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
17 changes: 8 additions & 9 deletions src/nwb/NWBFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,17 @@ NWBFile::NWBFile(std::shared_ptr<BaseIO> 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;
Expand Down Expand Up @@ -92,6 +86,11 @@ Status NWBFile::createFileStructure()
return Status::Success;
}

Status NWBFile::finalize()
{
return io->close();
}

Status NWBFile::createElectricalSeries(
std::vector<Types::ChannelVector> recordingArrays,
const BaseDataType& dataType,
Expand Down
10 changes: 6 additions & 4 deletions src/nwb/NWBFile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
/**
Expand Down Expand Up @@ -122,7 +125,6 @@ class NWBFile : public Container
const std::array<std::pair<std::string_view, std::string_view>, N>&
specVariables);

std::string identifierText; // TODO Remove this for read
static std::vector<SizeType> emptyContainerIndexes;
};

Expand Down

0 comments on commit c481260

Please sign in to comment.