String library.
Dependents: CheckSum RN41 RealTimeClock TVZ_MU_Seminar ... more
Diff: StrLib.h
- Revision:
- 7:7bc89a64bfbd
- Parent:
- 6:4447094b7e51
--- a/StrLib.h Fri Oct 09 05:20:44 2015 +0000 +++ b/StrLib.h Tue Oct 20 01:23:22 2015 +0000 @@ -1,25 +1,24 @@ #pragma once -#ifndef MBED_STRLIB_H -#define MBED_STRLIB_H - #include "mbed.h" #include <string> -/** String(Ascii) -> long(int) + +/** String(Ascii) -> "long long"(64bit) integer. * * @param string target(str), int Base(8:Oct, 10:Dec, 16:Hex) - * @return long int + * @return long long int. if -1; error. */ -long A2I(string, int); +long long A2I(string str, unsigned int base); /** int -> string * * @param int target(num), int Base(8:Oct, 10:Dec, 16:Hex), int Number of digit * @return string str */ -string I2A(int num, int base= 10, int digitNum= 0); +string I2A(int num, unsigned int base= 10, unsigned int digitNum= 0); +string I2A(long long num, unsigned int base= 10, unsigned int digitNum= 0); /** float -> string * @@ -46,5 +45,4 @@ */ string toAlpanumeric(string str, bool large=false); -#endif // EOF \ No newline at end of file