You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
875 B
40 lines
875 B
#pragma once
|
|
#include <stdarg.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
namespace iflytop {
|
|
|
|
class TJCStrUtils {
|
|
private:
|
|
/* data */
|
|
public:
|
|
/**
|
|
* @brief
|
|
*
|
|
* @param cpyto
|
|
* @param strbegin
|
|
* @param maxlen
|
|
* @return const char*
|
|
*
|
|
*
|
|
* @Usage:
|
|
* char input= { 1,2,3, '1','2','3','\0','1','2','3','\0','1','2','3','\0'};
|
|
*
|
|
* char strbuf0[20];
|
|
* char strbuf1[20];
|
|
* char strbuf2[20];
|
|
*
|
|
* const char* strbegin = &input[3];
|
|
* strbegin = TJCStrUtils::cpystr(strbuf0, strbegin, sizeof(strbuf0));
|
|
* strbegin = TJCStrUtils::cpystr(strbuf1, strbegin, sizeof(strbuf1));
|
|
* strbegin = TJCStrUtils::cpystr(strbuf2, strbegin, sizeof(strbuf2));
|
|
*
|
|
*/
|
|
|
|
static const char* cpystr(char* cpyto, const char* strbegin, int32_t maxlen);
|
|
};
|
|
|
|
} // namespace iflytop
|