String library.

Dependents:   CheckSum RN41 RealTimeClock TVZ_MU_Seminar ... more

Committer:
AkinoriHashimoto
Date:
Wed Sep 02 05:42:13 2015 +0000
Revision:
5:9afdff23f890
Parent:
4:17e03f0747d9
Child:
6:4447094b7e51
F2A; fill 0.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AkinoriHashimoto 0:058192932ad2 1 #pragma once
AkinoriHashimoto 0:058192932ad2 2
AkinoriHashimoto 0:058192932ad2 3 #include "mbed.h"
AkinoriHashimoto 0:058192932ad2 4 #include <string>
AkinoriHashimoto 1:7c89cd414311 5
AkinoriHashimoto 0:058192932ad2 6
AkinoriHashimoto 1:7c89cd414311 7 /** String(Ascii) -> long(int)
AkinoriHashimoto 3:ad74ab63f78c 8 *
AkinoriHashimoto 2:14f3ff21096e 9 * @param string target(str), int Base(8:Oct, 10:Dec, 16:Hex)
AkinoriHashimoto 0:058192932ad2 10 * @return long int
AkinoriHashimoto 0:058192932ad2 11 */
AkinoriHashimoto 1:7c89cd414311 12 long A2I(string, int);
AkinoriHashimoto 0:058192932ad2 13
AkinoriHashimoto 0:058192932ad2 14 /** int -> string
AkinoriHashimoto 3:ad74ab63f78c 15 *
AkinoriHashimoto 2:14f3ff21096e 16 * @param int target(num), int Base(8:Oct, 10:Dec, 16:Hex), int Number of digit
AkinoriHashimoto 0:058192932ad2 17 * @return string str
AkinoriHashimoto 0:058192932ad2 18 */
AkinoriHashimoto 1:7c89cd414311 19 string I2A(int num, int base= 10, int digitNum= 0);
AkinoriHashimoto 0:058192932ad2 20
AkinoriHashimoto 2:14f3ff21096e 21 /** float -> string
AkinoriHashimoto 3:ad74ab63f78c 22 *
AkinoriHashimoto 2:14f3ff21096e 23 * Overload; Output format.
AkinoriHashimoto 2:14f3ff21096e 24 * @param float target(num), int Field-width, int Number of decimal-places.
AkinoriHashimoto 2:14f3ff21096e 25 * @return string.
AkinoriHashimoto 2:14f3ff21096e 26 */
AkinoriHashimoto 5:9afdff23f890 27 string F2A(float num, int fieldWidth, int decimalPlaces, bool fill0= false);
AkinoriHashimoto 2:14f3ff21096e 28 string F2A(float num);
AkinoriHashimoto 2:14f3ff21096e 29
AkinoriHashimoto 0:058192932ad2 30 /** string Compare
AkinoriHashimoto 3:ad74ab63f78c 31 *
AkinoriHashimoto 0:058192932ad2 32 * @param string target, string cmp, int index in target
AkinoriHashimoto 0:058192932ad2 33 * @return bool
AkinoriHashimoto 0:058192932ad2 34 */
AkinoriHashimoto 0:058192932ad2 35 bool strCompare(string trg, string cmp, int idx); // trg内にcmpが存在する位置がidxか判定。
AkinoriHashimoto 1:7c89cd414311 36
AkinoriHashimoto 4:17e03f0747d9 37 bool strCompareComplete(string trg, string cmp);
AkinoriHashimoto 4:17e03f0747d9 38
AkinoriHashimoto 2:14f3ff21096e 39 /** Eraze others Alphameric, and convert lower-cases to capitals.
AkinoriHashimoto 3:ad74ab63f78c 40 *
AkinoriHashimoto 2:14f3ff21096e 41 * @param string target, bool to-capitals.
AkinoriHashimoto 2:14f3ff21096e 42 * @return string
AkinoriHashimoto 2:14f3ff21096e 43 */
AkinoriHashimoto 2:14f3ff21096e 44 string toAlpanumeric(string str, bool large=false);
AkinoriHashimoto 1:7c89cd414311 45
AkinoriHashimoto 2:14f3ff21096e 46 // EOF