String library.

Dependents:   CheckSum RN41 RealTimeClock TVZ_MU_Seminar ... more

Committer:
AkinoriHashimoto
Date:
Wed Sep 02 04:15:48 2015 +0000
Revision:
2:14f3ff21096e
Parent:
1:7c89cd414311
Child:
3:ad74ab63f78c
String Library.; ; The lib has I2A, A2I.

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 2:14f3ff21096e 8 * @param string target(str), int Base(8:Oct, 10:Dec, 16:Hex)
AkinoriHashimoto 0:058192932ad2 9 * @return long int
AkinoriHashimoto 0:058192932ad2 10 */
AkinoriHashimoto 1:7c89cd414311 11 long A2I(string, int);
AkinoriHashimoto 0:058192932ad2 12
AkinoriHashimoto 0:058192932ad2 13 /** int -> string
AkinoriHashimoto 2:14f3ff21096e 14 * @param int target(num), int Base(8:Oct, 10:Dec, 16:Hex), int Number of digit
AkinoriHashimoto 0:058192932ad2 15 * @return string str
AkinoriHashimoto 0:058192932ad2 16 */
AkinoriHashimoto 1:7c89cd414311 17 string I2A(int num, int base= 10, int digitNum= 0);
AkinoriHashimoto 0:058192932ad2 18
AkinoriHashimoto 2:14f3ff21096e 19 /** float -> string
AkinoriHashimoto 2:14f3ff21096e 20 * Overload; Output format.
AkinoriHashimoto 2:14f3ff21096e 21 * @param float target(num), int Field-width, int Number of decimal-places.
AkinoriHashimoto 2:14f3ff21096e 22 * @return string.
AkinoriHashimoto 2:14f3ff21096e 23 */
AkinoriHashimoto 2:14f3ff21096e 24 string F2A(float num, int fieldWidth, int decimalPlaces);
AkinoriHashimoto 2:14f3ff21096e 25 string F2A(float num);
AkinoriHashimoto 2:14f3ff21096e 26
AkinoriHashimoto 0:058192932ad2 27 /** string Compare
AkinoriHashimoto 0:058192932ad2 28 * @param string target, string cmp, int index in target
AkinoriHashimoto 0:058192932ad2 29 * @return bool
AkinoriHashimoto 0:058192932ad2 30 */
AkinoriHashimoto 0:058192932ad2 31 bool strCompare(string trg, string cmp, int idx); // trg内にcmpが存在する位置がidxか判定。
AkinoriHashimoto 1:7c89cd414311 32
AkinoriHashimoto 2:14f3ff21096e 33 /** Eraze others Alphameric, and convert lower-cases to capitals.
AkinoriHashimoto 2:14f3ff21096e 34 * @param string target, bool to-capitals.
AkinoriHashimoto 2:14f3ff21096e 35 * @return string
AkinoriHashimoto 2:14f3ff21096e 36 */
AkinoriHashimoto 2:14f3ff21096e 37 string toAlpanumeric(string str, bool large=false);
AkinoriHashimoto 1:7c89cd414311 38
AkinoriHashimoto 2:14f3ff21096e 39 // EOF