nx_metadata_sdk  1.0
Metadata SDK
utils.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2 
3 #pragma once
4 
5 #include <string>
6 #include <vector>
7 
8 namespace nx {
9 namespace vms_server_plugins {
10 namespace analytics {
11 namespace stub {
12 
13 bool toBool(std::string str);
14 
15 template<typename T>
16 T clamp(const T& value, const T& lowerBound, const T& upperBound)
17 {
18  if (value < lowerBound)
19  return lowerBound;
20 
21  if (value > upperBound)
22  return upperBound;
23 
24  return value;
25 }
26 
27 std::vector<char> loadFile(const std::string& path);
28 
29 std::string imageFormatFromPath(const std::string& path);
30 
31 bool isHttpOrHttpsUrl(const std::string& path);
32 
33 } // namespace stub
34 } // namespace analytics
35 } // namespace vms_server_plugins
36 } // namespace nx
Definition: apple_utils.h:6