aqnwb 0.3.0
Loading...
Searching...
No Matches
Utils.hpp File Reference
#include <algorithm>
#include <array>
#include <chrono>
#include <cmath>
#include <cstdint>
#include <ctime>
#include <iomanip>
#include <random>
#include <regex>
#include <sstream>
#include <string>
#include "io/BaseIO.hpp"
#include "io/hdf5/HDF5IO.hpp"
Include dependency graph for Utils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  AQNWB
 The main namespace for AqNWB.
namespace  AQNWB::detail

Functions

std::tm AQNWB::detail::to_local_time (std::time_t time_value)
 Convert a std::time_t value to a local std::tm structure.
std::tm AQNWB::detail::to_utc_time (std::time_t time_value)
 Convert a std::time_t value to a UTC std::tm structure.
long AQNWB::detail::get_utc_offset_seconds (std::time_t time_value)
 Get the UTC offset in seconds for a given time_t value.
std::string AQNWB::detail::format_utc_offset (long offset_seconds)
 Format a UTC offset in seconds as a string (+HH:MM or -HH:MM).
uint16_t AQNWB::detail::to_little_endian_u16 (uint16_t value)
 Convert a 16-bit unsigned integer to little-endian byte order.
static std::string AQNWB::generateUuid ()
 Generates a UUID (Universally Unique Identifier) as a string.
static std::string AQNWB::getCurrentTime ()
 Get the current time in ISO 8601 format with the UTC offset.
static bool AQNWB::isISO8601Date (const std::string &dateStr)
 Check that a string is formatted in ISO8601 format.
static std::shared_ptr< IO::BaseIOAQNWB::createIO (const std::string &type, const std::string &filename)
 Factory method to create an IO object of the specified type.
static std::string AQNWB::mergePaths (const std::string &path1, const std::string &path2)
 Merge two paths into a single path, handling extra trailing and starting "/".
static void AQNWB::convertFloatToInt16LE (const float *source, void *dest, SizeType numSamples)
 Method to convert float values to uint16 values. This method was adapted from JUCE AudioDataConverters using a default value of destBytesPerSample = 2.
static std::unique_ptr< int16_t[]> AQNWB::transformToInt16 (SizeType numSamples, float conversion_factor, const float *data)
 Method to scale float values and convert to int16 values.
static bool AQNWB::isValidIndex (SizeType index)
 Check if a SizeType index is valid (i.e., not equal to SizeTypeNotSet).
static Status AQNWB::intToStatus (int status)
 Convert an integer status code to a Types::Status enum value. Shorthand for return (status < 0) ? Status::Failure : Status::Success;.
static void AQNWB::checkStatus (Status status, const std::string &operation)
 Check status and print to standard error.