mirror of
https://onedev.site.tesses.net/crosslang
synced 2026-02-08 17:15:45 +00:00
Add plink tag
This commit is contained in:
@@ -1327,6 +1327,26 @@ namespace Tesses::CrossLang
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static TObject Net_Http_HtmlP(GCList& ls, std::vector<TObject> args)
|
||||
{
|
||||
std::string str;
|
||||
if(GetArgument(args,0,str))
|
||||
{
|
||||
return HttpUtils::HtmlP(str);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
static TObject Net_Http_StatusCodeString(GCList& ls, std::vector<TObject> args)
|
||||
{
|
||||
int64_t sc;
|
||||
if(GetArgument(args,0,sc))
|
||||
{
|
||||
return HttpUtils::StatusCodeString((StatusCode)sc);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
void TStd::RegisterNet(GC* gc, TRootEnvironment* env)
|
||||
{
|
||||
@@ -1337,6 +1357,8 @@ namespace Tesses::CrossLang
|
||||
|
||||
TDictionary* http = TDictionary::Create(ls);
|
||||
TDictionary* smtp = TDictionary::Create(ls);
|
||||
http->DeclareFunction(gc, "StatusCodeString", "Get the status code string",{"statusCode"},Net_Http_StatusCodeString);
|
||||
http->DeclareFunction(gc, "HtmlP", "Linkify text", {"text"},Net_Http_HtmlP);
|
||||
http->DeclareFunction(gc, "HtmlEncode","Html encode",{"param"}, Net_HtmlEncode);
|
||||
|
||||
http->DeclareFunction(gc, "UrlEncode","Url encode query param",{"param"}, Net_UrlEncode);
|
||||
|
||||
@@ -116,13 +116,30 @@ namespace Tesses::CrossLang {
|
||||
|
||||
TObject Sqlite_Escape(GCList& ls, std::vector<TObject> args)
|
||||
{
|
||||
int64_t n;
|
||||
double d;
|
||||
bool b;
|
||||
|
||||
|
||||
std::string str;
|
||||
if(GetArgument(args,0,str))
|
||||
{
|
||||
return SQLiteDatabase::Escape(str);
|
||||
}
|
||||
if(GetArgument(args,0,n))
|
||||
{
|
||||
return std::to_string(n);
|
||||
}
|
||||
if(GetArgument(args,0,b))
|
||||
{
|
||||
return b ? "1" : "0";
|
||||
}
|
||||
if(GetArgument(args,0,d))
|
||||
{
|
||||
return std::to_string(d);
|
||||
}
|
||||
|
||||
return Undefined();
|
||||
return "NULL";
|
||||
}
|
||||
|
||||
TObject Sqlite_Close(GCList& ls, std::vector<TObject> args)
|
||||
|
||||
Reference in New Issue
Block a user