13 Star 69 Fork 22

johnsonyl/cpps

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cpps_api.cpp 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
#include "cpps/cpps.h"
namespace cpps {
bool cpps_isbasevar(const cpps_value &v)
{
return cpps_isnumber(v) || cpps_isint(v) || cpps_isbool(v);
}
bool cpps_isstring(const cpps_value &v)
{
return v.tt == CPPS_TSTRING;
}
bool cpps_isvector(const cpps_value &v)
{
return v.is_kindof<cpps_vector>();
}
bool cpps_isrange(const cpps_value &v)
{
return v.is_kindof<cpps_range>();
}
bool cpps_ismap(const cpps_value &v)
{
return v.is_kindof<cpps_map>();
}
bool cpps_ispair(const cpps_value &v)
{
return v.is_kindof<cpps_pair>();
}
bool cpps_isset(const cpps_value &v)
{
return v.is_kindof<cpps_set>();
}
bool cpps_isint(const cpps_value &v)
{
return v.tt == CPPS_TINTEGER || v.tt == CPPS_TUINTEGER;
}
bool cpps_ischar(const cpps_value& v)
{
return v.tt == CPPS_TSTRINGV;
}
bool cpps_isuint(const cpps_value &v)
{
return v.tt == CPPS_TUINTEGER;
}
bool cpps_isbool(const cpps_value &v)
{
return v.tt == CPPS_TBOOLEAN;
}
bool cpps_isnumber(const cpps_value &v)
{
return v.tt == CPPS_TNUMBER;
}
bool cpps_isnull(const cpps_value &v)
{
return v.tt == CPPS_TNIL;
}
bool cpps_isclassvar(const cpps_value &v)
{
return v.tt == CPPS_TCLASSVAR;
}
bool cpps_isclass(const cpps_value &v)
{
return v.tt == CPPS_TCLASS;
}
bool cpps_isellipsis(const cpps_value &v)
{
return v.tt == CPPS_TELLIPSIS;
}
bool cpps_istuple(const cpps_value &v)
{
return v.tt == CPPS_TTUPLE;
}
bool cpps_isfunction(const cpps_value& v)
{
return v.tt == CPPS_TFUNCTION || v.tt == CPPS_TLAMBDAFUNCTION;
}
std::string cpps_getclassname(const cpps_value& v)
{
return v.isdomain() ? v.value.domain->domainname : "";
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/cppscript/cpps.git
git@gitee.com:cppscript/cpps.git
cppscript
cpps
cpps
master

搜索帮助