cpp-common: add `dataFromFile()`
[babeltrace.git] / src / cpp-common / bt2c / file-utils.hpp
diff --git a/src/cpp-common/bt2c/file-utils.hpp b/src/cpp-common/bt2c/file-utils.hpp
new file mode 100644 (file)
index 0000000..9890f0a
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2022 Francis Deslauriers <francis.deslauriers@efficios.com>
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#ifndef BABELTRACE_CPP_COMMON_FILE_UTILS_HPP
+#define BABELTRACE_CPP_COMMON_FILE_UTILS_HPP
+
+#include <cstdint>
+#include <vector>
+
+namespace bt2c {
+
+/*
+ * Returns a vector of all the bytes contained in `path`.
+ */
+std::vector<std::uint8_t> dataFromFile(const char *path);
+
+} /* namespace bt2c */
+
+#endif /* BABELTRACE_CPP_COMMON_FILE_UTILS_HPP */
This page took 0.023139 seconds and 4 git commands to generate.