Index: helpers.h |
diff --git a/helpers.h b/helpers.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b922da69468b94a6cc1a3bf3850c0b2c8ab93fc7 |
--- /dev/null |
+++ b/helpers.h |
@@ -0,0 +1,24 @@ |
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+// |
+// Provides basic file reading and parsing helpers for use in PlatformReader |
+// and PlatformReader derived classes. Nothing fancy. |
+ |
+#ifndef CROS_BOOT_MODE_HELPERS_H_ |
+#define CROS_BOOT_MODE_HELPERS_H_ |
+ |
+#include <sys/types.h> |
+ |
+namespace cros_boot_mode { |
+namespace helpers { |
+ |
+// atoi, using sscanf |
+int to_int(const char *str, size_t length); |
+ |
+// very simple wrapper of fopen,fread,fclose. |
+size_t read_file(const char *path, char *buf, size_t max_bytes); |
+ |
+} // namespace helpers |
+} // namespace cros_boot_mode |
+#endif // CROS_BOOT_MODE_HELPERS_H_ |