/workspaces/astro/sol3-sdk/cpp/sol3/core/file_identifier.h Source File

Space-ng SDK: /workspaces/astro/sol3-sdk/cpp/sol3/core/file_identifier.h Source File
Space-ng SDK
file_identifier.h
Go to the documentation of this file.
1 // Copyright (c) Space-ng, inc. All rights reserved.
2 #pragma once
3 
4 #include <cstdint>
5 #include <string>
6 
7 namespace sol3 {
8 namespace core {
9 
15 uint32_t constexpr makeFileIdentifier(char const s[4]) {
16  return (
17  uint32_t(s[0]) | (uint32_t(s[1]) << 8) | (uint32_t(s[2]) << 16) |
18  (uint32_t(s[3]) << 24));
19 }
20 
22 template <typename TMessageT>
23 uint32_t constexpr makeFileIdentifier() {
24  return makeFileIdentifier(TMessageT::GetIdentifier());
25 }
26 
28 std::string stringFromFileIdentifier(uint32_t v);
29 
30 } // namespace core
31 } // namespace sol3
constexpr uint32_t makeFileIdentifier(char const s[4])
Definition: file_identifier.h:15
std::string stringFromFileIdentifier(uint32_t v)
Converts a file identifier to a printable 4-character string.
Definition: carrier_board_msg_spec.h:10