Station API

Dependents:   GMCStation

Revision:
2:a9d1a9c92927
Parent:
1:a22e390c70b3
--- a/Utils.h	Mon Dec 12 02:33:21 2011 +0000
+++ b/Utils.h	Mon Dec 12 11:41:24 2011 +0000
@@ -27,8 +27,17 @@
 #include <ctype.h>
 #include <stdarg.h>
 
+/**
+ * Utility functions
+ */
 class Utils {
 public:
+    /**
+     * encodes string in percent encoding
+     *
+     * @param s source string
+     * @param t encoded string
+     */
     static int encodeFormUrl(char *s, char *t) {
         char *head = t;
         for (char c; (c = *s) != 0; s++)
@@ -45,6 +54,13 @@
         return t - head;
     }
 
+    /**
+     * encodes data to BASE64 string
+     *
+     * @param ibuf input buffer
+     * @param length length of the input data
+     * @param obuf output buffer
+     */
     static void encodeBase64(char ibuf[], int length, char *obuf) {
         const char BASE64[] =
             "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@@ -59,10 +75,21 @@
         obuf[i] = '\0';
     }
 
+    /**
+     * encodes string to BASE64 string
+     * @param ibuf input string buffer
+     * @param obuf output buffer
+     */
     static void encodeBase64(char *ibuf, char *obuf) {
         encodeBase64(ibuf, strlen(ibuf), obuf);
     }
 
+    /**
+     * gets values from a file according to the specified pattern format
+     *
+     * @param fp pointer to the input FILE
+     * @param pattern scanf format string, followed by variables to store the retrieved data
+     */
     static bool fgetValues(FILE *fp, const char *pattern, ...) {
         va_list argv;
         va_start(argv, pattern);