Introduce new helpers

This commit is contained in:
2023-11-16 16:04:09 +01:00
parent df21c45a13
commit 4c2af98602
3 changed files with 21 additions and 1 deletions

View File

@@ -109,7 +109,7 @@ namespace OpenVulkano::AR
[[nodiscard]] ArTrackingState GetTrackingState() const { return frameMetadata.trackingState; }; [[nodiscard]] ArTrackingState GetTrackingState() const { return frameMetadata.trackingState; };
[[nodiscard]] virtual Math::PoseF GetPose() const {}; //TODO [[nodiscard]] virtual Math::PoseF GetPose() const { return Math::PoseF({}); }; //TODO
[[nodiscard]] Math::Timestamp GetTimestamp() const { return frameMetadata.timestamp; }; [[nodiscard]] Math::Timestamp GetTimestamp() const { return frameMetadata.timestamp; };

View File

@@ -0,0 +1,13 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#ifdef __cplusplus
#define EXTERN_C extern "C" {
#define EXTERN_C_END }
#else
#define EXTERN_C
#define EXTERN_C_END
#endif

View File

@@ -127,6 +127,13 @@ namespace OpenVulkano
return str.size() >= suffix.size() && 0 == str.compare(str.size()-suffix.size(), suffix.size(), suffix); return str.size() >= suffix.size() && 0 == str.compare(str.size()-suffix.size(), suffix.size(), suffix);
} }
static std::pair<std::string, std::string> SplitAtLastOccurrence(const std::string& str, char splitAt)
{
size_t pos = str.rfind(splitAt);
if (pos == std::string::npos) return {str, ""};
else return {str.substr(0, pos), str.substr(pos + 1)};
}
static Array<char> ReadFile(const std::string& filePath); static Array<char> ReadFile(const std::string& filePath);
}; };
} }