ARSA Language  2.8
(Encryption, GPU and Web 3.0)
cloud.h File Reference

Go to the source code of this file.

Functions

void att (const string *name, const string *value)
 add pair datas be attribute. More...
 
void attfree ()
 
const char * send (const char *url, bool use_attribute=true)
 Send attribute to server through url be endpoint. This is POST method and parameters (attribute) is concat from endpoint. More...
 
bool download (const char *url, const char *new_filename="", int file_size=0)
 download file from server support url is direct, google drive, onedrive, dropbox or etc. More...
 

Detailed Description

ARSA Language, cloud operations:
Communication to server through script.

Definition in file cloud.h.

Function Documentation

◆ att()

void att ( const string name,
const string value 
)

add pair datas be attribute.

Parameters
namename of attribute.
valuevalue of attribute.
NOTE: MUST CALL attfree() when done.
See also
attfree()

Example:
att( "name", "xxx" )
att( "address", "yyy" )
att( "gamename", "zzz" )
// do some stuff...
attfree() // free attribute

◆ attfree()

void attfree ( )

free memory of attribute

See also
att()

◆ download()

bool download ( const char *  url,
const char *  new_filename = "",
int  file_size = 0 
)

download file from server support url is direct, google drive, onedrive, dropbox or etc.

Parameters
urlis endpoint may be http or https.
new_filenamewhen user download from google drive, onedrive, dropbox then you should define a new name of download file. default is "".
file_sizeif you known file size. this use in callback function when download operating. default is 0.
Returns
true download file successed and a location is same psd file that called, false is cannot download.
See also
send()


Example direct download:

download("http://sarosworld.com/chars4_bg.psd")

Example direct download with new name:

download("http://sarosworld.com/chars4_bg.psd", "a.psd")

Example google drive download with new name:

download("https://drive.google.com/uc?export=download&id=16lbkfUdRPw61RyBb9IjbGsQPHom-FWYq", "test.png")

◆ send()

const char* send ( const char *  url,
bool  use_attribute = true 
)

Send attribute to server through url be endpoint. This is POST method and parameters (attribute) is concat from endpoint.

Parameters
urlis endpoint may be http or https.
use_attributeuse attribute be parameter.
Returns
string message from server.
See also
att(), alog()

Example:
att( "username", "abc" ) // set attribute
att( "password", "123456" )
set( $ret, send("https://abc.com/login.php", true) ) // call send() function and keep return value to $ret variable.
attfree() // free attribute
alog("result is: $ret") // show result through log window