3636 * @param raw A string to be encoded
3737 * @return A string encoded in base64
3838 */
39- std::string encode_base64 (const std::string raw) {
39+ inline std::string encode_base64 (const std::string raw) {
4040 std::string encoded = absl::Base64Escape (raw);
4141 return encoded;
4242}
@@ -50,7 +50,7 @@ std::string encode_base64(const std::string raw) {
5050 * @return A string representing the dtype in numpy format limited to the dtypes
5151 * supported by MDIO Dataset
5252 */
53- tensorstore::Result<std::string> to_zarr_dtype (const std::string dtype) {
53+ inline tensorstore::Result<std::string> to_zarr_dtype (const std::string dtype) {
5454 // Convert the input dtype to Zarr dtype
5555 if (dtype == " int8" ) {
5656 return " <i1" ;
@@ -93,8 +93,8 @@ tensorstore::Result<std::string> to_zarr_dtype(const std::string dtype) {
9393 * @return OkStatus if successful, InvalidArgumentError if dtype is not
9494 * supported
9595 */
96- absl::Status transform_dtype (nlohmann::json& input /* NOLINT*/ ,
97- nlohmann::json& variable /* NOLINT*/ ) {
96+ inline absl::Status transform_dtype (nlohmann::json& input /* NOLINT*/ ,
97+ nlohmann::json& variable /* NOLINT*/ ) {
9898 if (input[" dataType" ].contains (" fields" )) {
9999 nlohmann::json dtypeFields = nlohmann::json::array ();
100100 for (const auto & field : input[" dataType" ][" fields" ]) {
@@ -124,8 +124,8 @@ absl::Status transform_dtype(nlohmann::json& input /*NOLINT*/,
124124 * @return OkStatus if successful, InvalidArgumentError if compressor is invalid
125125 * for MDIO
126126 */
127- absl::Status transform_compressor (nlohmann::json& input /* NOLINT*/ ,
128- nlohmann::json& variable /* NOLINT*/ ) {
127+ inline absl::Status transform_compressor (nlohmann::json& input /* NOLINT*/ ,
128+ nlohmann::json& variable /* NOLINT*/ ) {
129129 if (input.contains (" compressor" )) {
130130 if (input[" compressor" ].contains (" name" )) {
131131 if (input[" compressor" ][" name" ] != " blosc" ) {
@@ -182,7 +182,7 @@ absl::Status transform_compressor(nlohmann::json& input /*NOLINT*/,
182182 * before this step This presumes that the user does not attempt to use these
183183 * functions directly
184184 */
185- void transform_shape (
185+ inline void transform_shape (
186186 nlohmann::json& input /* NOLINT*/ , nlohmann::json& variable /* NOLINT*/ ,
187187 std::unordered_map<std::string, uint64_t >& dimensionMap /* NOLINT*/ ) {
188188 if (input[" dimensions" ][0 ].is_object ()) {
@@ -208,8 +208,8 @@ void transform_shape(
208208 * @param variable A Variable stub (Will be modified)
209209 * @return OkStatus if successful, InvalidArgumentError if the path is invalid
210210 */
211- absl::Status transform_metadata (const std::string& path,
212- nlohmann::json& variable /* NOLINT*/ ) {
211+ inline absl::Status transform_metadata (const std::string& path,
212+ nlohmann::json& variable /* NOLINT*/ ) {
213213 std::string bucket =
214214 " NULL" ; // Default value, if is NULL don't add a bucket field
215215 std::string driver = " file" ;
@@ -261,7 +261,7 @@ absl::Status transform_metadata(const std::string& path,
261261 * @param dimensionMap A map of dimension names to sizes
262262 * @return A Variable spec or an error if the Variable spec is invalid
263263 */
264- tensorstore::Result<nlohmann::json> from_json_to_spec (
264+ inline tensorstore::Result<nlohmann::json> from_json_to_spec (
265265 nlohmann::json& json /* NOLINT*/ ,
266266 std::unordered_map<std::string, uint64_t >& dimensionMap /* NOLINT*/ ,
267267 const std::string& path) {
@@ -404,8 +404,8 @@ tensorstore::Result<nlohmann::json> from_json_to_spec(
404404 * @return A map of dimension names to sizes or error if the dimensions are not
405405 * consistently sized
406406 */
407- tensorstore::Result<std::unordered_map<std::string, uint64_t >> get_dimensions (
408- nlohmann::json& spec /* NOLINT*/ ) {
407+ inline tensorstore::Result<std::unordered_map<std::string, uint64_t >>
408+ get_dimensions ( nlohmann::json& spec /* NOLINT*/ ) {
409409 std::unordered_map<std::string, uint64_t > dimensions;
410410 for (auto & variable : spec[" variables" ]) {
411411 if (variable[" dimensions" ][0 ].is_object ()) {
@@ -438,7 +438,8 @@ tensorstore::Result<std::unordered_map<std::string, uint64_t>> get_dimensions(
438438 * @param spec A Dataset spec
439439 * @return A vector of Variable specs or an error if the Dataset spec is invalid
440440 */
441- tensorstore::Result<std::tuple<nlohmann::json, std::vector<nlohmann::json>>>
441+ inline tensorstore::Result<
442+ std::tuple<nlohmann::json, std::vector<nlohmann::json>>>
442443Construct (nlohmann::json& spec /* NOLINT*/ , const std::string& path) {
443444 // Validation should only return status codes. If it returns data then it
444445 // should be a "constructor"
0 commit comments