Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Unified Diff: helpers.h

Issue 3530001: first cut: establishes base helper classes and main (Closed) Base URL: http://git.chromium.org/git/cros_boot_mode.git
Patch Set: truncation is bad, m'kay. . . Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « developer_switch_unittest.cc ('k') | helpers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « developer_switch_unittest.cc ('k') | helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698