#include "cpps/cpps.h"namespace cpps{std::string transformat(std::string fmt, cpps_value v){char buffer[1024];if (v.tt == CPPS_TSTRING){std::string *tmpStr = cpps_get_string(v);sprintf(buffer, fmt.c_str(), tmpStr->c_str());}else if (v.tt == CPPS_TBOOLEAN){sprintf(buffer, fmt.c_str(), v.value.b != 0);}else if (v.tt == CPPS_TNUMBER){sprintf(buffer, fmt.c_str(), v.value.number);}else if (v.tt == CPPS_TINTEGER){sprintf(buffer, fmt.c_str(), v.value.integer);}return buffer;}size_t formatcheck(C *c,std::string &fmt, size_t j, size_t i, std::string &take, cpps_value &v){std::string newstr = "";switch (fmt[j]){case 'd':case 'u':case 'o':case 'c':case 'i':case 'X':case 'x':newstr = transformat(take, cpps_to_integer(v));fmt.replace(i, take.size(), newstr);break;case 'f':newstr = transformat(take, cpps_to_number(v));fmt.replace(i, take.size(), newstr);break;case 's':newstr = transformat(take, cpps_value(c, cpps_to_string(v)));fmt.replace(i, take.size(), newstr);break;default:break;}return newstr.size();}cpps::cpps_regparentclass* make_parentclass(cpps_cppsclass* _cppsclass){return CPPSNEW( cpps_regparentclass)(_cppsclass);}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型