utils.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <algorithm>
4 #include <regex>
5 #include <stdexcept>
6 #include <string>
7 #include <utility>
8 #include <vector>
9 
10 namespace foxglove_bridge {
11 
12 inline std::pair<std::string, std::string> getNodeAndNodeNamespace(const std::string& fqnNodeName) {
13  const std::size_t found = fqnNodeName.find_last_of("/");
14  if (found == std::string::npos) {
15  throw std::runtime_error("Invalid fully qualified node name: " + fqnNodeName);
16  }
17  return std::make_pair(fqnNodeName.substr(0, found), fqnNodeName.substr(found + 1));
18 }
19 
20 } // namespace foxglove_bridge
std::pair< std::string, std::string > getNodeAndNodeNamespace(const std::string &fqnNodeName)
Definition: utils.hpp:12


foxglove_bridge
Author(s): Foxglove
autogenerated on Mon Jul 3 2023 02:12:22