本文整理汇总了C++中POST函数的典型用法代码示例。如果您正苦于以下问题:C++ POST函数的具体用法?C++ POST怎么用?C++ POST使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了POST函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: buff_post
void buff_post(void *x, t_buff_info *buff)
{
if (buff->has_obj == false) { POST("Buffer \"%s\" not found.", buff->sym->s_name); }
else {
POST("Buffer \"%s\": Channels: %i - Frames: %i - Samplerate (smp / ms): %f",
buff->sym->s_name, buff->ch_cnt, buff->fr_cnt, buff->msr); }
}
开发者ID:ycandau,项目名称:buff.filter,代码行数:7,代码来源:buff_util.c
示例2: POST
void BST<T>::POST (const TreeNode<T> *n) const {
if (n != NULL) {
POST (n->left);
POST (n->right);
std::cout << n->v << " ";
}
}
开发者ID:RuofanKong,项目名称:Algorithms,代码行数:7,代码来源:BinarySearchTree.cpp
示例3: _defer_delete
void _defer_delete(t_filesys *x, t_symbol *sym, long argc, t_atom *argv)
{
TRACE("_defer_delete");
char str_cur[MAX_PATH_CHARS];
t_symbol *sym_cur = atom_getsym(argv);
_filesys_get_path(x, sym_cur->s_name, str_cur);
// Try deleting the file
int err = 0;
#ifdef WIN_VERSION
err = remove(str_cur);
#endif
#ifdef MAC_VERSION
err = remove(str_cur);
#endif
// In case of success
if (!err) { if (x->a_verbose) { POST("Removing: %s", sym_cur->s_name); } }
// ... otherwise post an error message
else {
switch (errno) {
case EACCES: MY_ERR("delete: File is open or read-only: \"%s\"",
sym_cur->s_name); break;
case ENOENT: MY_ERR("delete: File not found: \"%s\"", sym_cur->s_name); break;
default: MY_ERR("delete: Unknown error: %i", errno); break; } }
// Send a 0 or 1 message to indicate failure or success
outlet_int(x->outl_return, err ? 0 : 1);
}
开发者ID:ycandau,项目名称:y.filesys,代码行数:35,代码来源:y_filesys.c
示例4: _dict_recurse_value_find
void _dict_recurse_value_find(t_dict_recurse *x, t_atom *value, const char* str)
{
TRACE("_dict_recurse_value_find");
switch (x->command) {
case CMD_FIND_KEY:
if (x->has_match) { POST(" %s %s", x->path, str); }
x->has_match = false; // reset matching state
case CMD_FIND_KEY_IN:
if (x->has_match) { POST(" %s %s", x->path, str); }
break;
default: break; }
}
开发者ID:ycandau,项目名称:dict.recurse,代码行数:16,代码来源:dict.recurse.c
示例5: dns_rpz_policy2str
const char *
dns_rpz_policy2str(dns_rpz_policy_t policy) {
const char *str;
switch (policy) {
case DNS_RPZ_POLICY_PASSTHRU:
str = "PASSTHRU";
break;
case DNS_RPZ_POLICY_NXDOMAIN:
str = "NXDOMAIN";
break;
case DNS_RPZ_POLICY_NODATA:
str = "NODATA";
break;
case DNS_RPZ_POLICY_RECORD:
str = "Local-Data";
break;
case DNS_RPZ_POLICY_CNAME:
case DNS_RPZ_POLICY_WILDCNAME:
str = "CNAME";
break;
default:
str = "";
POST(str);
INSIST(0);
}
return (str);
}
开发者ID:jordanhubbard,项目名称:freebsd,代码行数:28,代码来源:rpz.c
示例6: streaming_readfunc
size_t streaming_readfunc(void* ptr, size_t size, size_t nmemb, void* stream) {
LOG(LOG_INFO, "entry\n");
IOBuf* b = (IOBuf*)stream;
ObjectStream* os = (ObjectStream*)b->user_data;
size_t total = (size * nmemb);
LOG(LOG_INFO, "(%08lx) curl buff %ld\n", (size_t)os, total);
// wait for producer to fill buffers
WAIT(&os->iob_full);
LOG(LOG_INFO, "(%08lx) avail-data: %ld\n", (size_t)os, b->avail);
// maybe we were requested to quit or abort?
if (b->write_count == 0) {
// called by stream_sync()
LOG(LOG_INFO, "(%08lx) got EOF\n", (size_t)os);
POST(&os->iob_empty); // polite
return 0;
}
else if (b->first->buf == (char*)1) {
// called by stream_abort()
LOG(LOG_INFO, "(%08lx) got ABORT\n", (size_t)os);
POST(&os->iob_empty); // polite
return CURL_READFUNC_ABORT;
}
// move producer's data into curl buffers.
// (Might take more than one callback)
size_t move_req = ((total <= b->avail) ? total : b->avail);
size_t moved = aws_iobuf_get_raw(b, (char*)ptr, move_req);
// track total size
os->written += moved;
LOG(LOG_INFO, "(%08lx) moved %ld (total: %ld)\n", (size_t)os, moved, os->written);
if (b->avail) {
LOG(LOG_INFO, "(%08lx) iterating (avail: %ld)\n", (size_t)os, b->avail);
POST(&os->iob_full); // next callback is pre-approved
}
else {
LOG(LOG_INFO, "(%08lx) done with buffer (total written %ld)\n", (size_t)os, os->written);
POST(&os->iob_empty); // tell producer that buffer is used
}
return moved;
}
开发者ID:GiorgioRegni,项目名称:marfs,代码行数:46,代码来源:object_stream.c
示例7: PRE_MSG
/// Initializes the global state of the CLI.
///
/// This function can only be called once during the execution of a program,
/// unless override_for_testing is set to true.
///
/// \param argv0 The value of argv[0]; i.e. the program name.
/// \param override_for_testing Should always be set to false unless for tests
/// of this functionality, which may set this to true to redefine internal
/// state.
void
cmdline::init(const char* argv0, const bool override_for_testing)
{
if (!override_for_testing)
PRE_MSG(Progname.empty(), "cmdline::init called more than once");
Progname = utils::fs::path(argv0).leaf_name();
LD(F("Program name: %s") % Progname);
POST(!Progname.empty());
}
开发者ID:Bhudipta,项目名称:minix,代码行数:18,代码来源:globals.cpp
示例8: atomsFromPackPrivate
void atomsFromPackPrivate(ListCount count, t_atom* listReturn, Pack* pack, unsigned int* index)
{
POST("count: %i, index: %i", count, (*index));
listReturn[(*index)] = pack->name;
/*char buf[256];
atom_string(& listReturn[*index],buf, 256);
POST("Writing: [%i] = %s",*index,buf);*/
unsigned int indexStart = (*index);
(*index) += 2;
ElementPackOrAtom* pElement=ListPackOrAtomGetFirst( & pack -> listSub);
if(pElement)
{
do
{
PackOrAtom* pPackOrAtom= pElement -> pData;
if(pPackOrAtom->isAtom)
{
listReturn[*index] = pPackOrAtom->atom;
/*char buf[256];
atom_string(& listReturn[*index],buf, 256);
POST("Writing: [%i] = %s",*index,buf);*/
(*index) += 1;
}
else
{
atomsFromPackPrivate( count- (*index), listReturn, &pPackOrAtom->pack, index);
//POST("end recursion!");
/*POST("INFO:");
char hurz[256];
atom_string(listReturn+temp,hurz,256);
post(hurz);*/
}
pElement = ListPackOrAtomGetNext( &pack->listSub, pElement);
}
while(pElement);
}
SETFLOAT(&listReturn[indexStart+1], (*index)-indexStart-2);
/*char buf2[256];
atom_string(& listReturn[indexStart+1], buf2, 256);
POST("Writing: [%i] = %s",indexStart+1,buf2);*/
/*
char buf3[256] = "";
//POST("indexStart: %i",indexStart,count
for(int i = indexStart; i < indexStart+count; i++)
{
atom_string(listReturn+i,buf3,256);
//post(buf3);
POST("\tatomList[%i]: %s", i, buf3);
}
*/
}
开发者ID:EsGeh,项目名称:sgCLib,代码行数:55,代码来源:Pack.c
示例9: dict_re_simulate
void dict_re_simulate(t_dict_recurse *x, t_symbol *sym, long argc, t_atom *argv)
{
TRACE("dict_re_simulate");
t_bool test = re_simulate(x->re2, atom_getsym(argv)->s_name);
MY_ASSERT(x->re2->err != ERR_NONE, "Simulation error.");
POST("Search: %s - Match: %s%s%s - %s", x->re2->re_search_s, atom_getsym(argv)->s_name,
(x->re2->repl_sub_cnt) ? " - Replace: " : "", (x->re2->repl_sub_cnt) ? x->re2->replace_p : "",
test ? "MATCH" : "NO MATCH");
}
开发者ID:ycandau,项目名称:dict.recurse,代码行数:11,代码来源:dict.recurse.c
示例10: send
String thethingsiOClient::send() {
String received = "";
if (POST(regular_client, "/v2/things/" + token, "{\"values\":[" + data + "]}")) {
data = "";
delay(1000);
while (regular_client->available()) {
char c = (char)regular_client->read();
received.concat(c);
}
}
return received;
}
开发者ID:mathresearch,项目名称:thethingsio-arduino-library,代码行数:12,代码来源:thethingsiOClient.cpp
示例11: dict_re_compile
void dict_re_compile(t_dict_recurse *x, t_symbol *sym, long argc, t_atom *argv)
{
TRACE("dict_re_compile");
if (argc == 1) { re_compile(x->re2, atom_getsym(argv)->s_name, NULL); }
else if (argc == 2) { re_compile(x->re2, atom_getsym(argv)->s_name, atom_getsym(argv + 1)->s_name); }
MY_ASSERT(x->re2->err != ERR_NONE, "Compilation error.");
POST("Compile: %s %s - RPN: %s - States: %i - Flags: %i - Substr: %i %s",
x->re2->re_search_s, atom_getsym(argv + 1)->s_name, x->re2->rpn_s, x->re2->state_cnt,
x->re2->capt_flags, x->re2->repl_sub_cnt, x->re2->repl_sub_s);
}
开发者ID:ycandau,项目名称:dict.recurse,代码行数:13,代码来源:dict.recurse.c
示例12: stream_get
// Accept as much as <size>, from the streaming GET, into caller's <buf>.
// We may discover EOF at any time. In that case, we'll return however
// much was actually read. The next call
// will just short-circuit to return 0, signalling EOF to caller.
//
// return -1 with errno, for failures.
// else return number of chars we get.
//
ssize_t stream_get(ObjectStream* os,
char* buf,
size_t size) {
static const int get_timeout_sec = 10; /* totally made up out of thin air */
IOBuf* b = &os->iob; // shorthand
LOG(LOG_INFO, "entry\n");
if (! (os->flags & OSF_OPEN)) {
LOG(LOG_ERR, "%s isn't open\n", os->url);
errno = EINVAL; /* ?? */
return -1;
}
if (! (os->flags & OSF_READING)) {
LOG(LOG_ERR, "%s isn't open for reading\n", os->url);
errno = EINVAL; /* ?? */
return -1;
}
if (os->flags & OSF_EOF) {
LOG(LOG_INFO, "already at EOF\n");
return 0; // b->write_count;
}
os->flags &= ~(OSF_EOB);
aws_iobuf_reset(b); // doesn't affect <user_data>
aws_iobuf_extend_static(b, (char*)buf, size);
LOG(LOG_INFO, "got %ld-byte buffer for writefn\n", size);
// let writefn move data
POST(&os->iob_empty);
// wait for writefn to fill our buffer
LOG(LOG_INFO, "waiting for writefn\n");
SAFE_WAIT(&os->iob_full, get_timeout_sec, os);
// SAFE_WAIT_KILL(&os->iob_full, get_timeout_sec, os);
// writefn detected CURL EOF?
if (os->flags & OSF_EOF) {
LOG(LOG_INFO, "EOF is asserted\n");
}
if (os->flags & OSF_EOB) {
LOG(LOG_INFO, "EOB is asserted\n");
}
os->written += b->write_count;
LOG(LOG_INFO, "returning %ld (total=%ld)\n", b->write_count, os->written);
return (b->write_count);
}
开发者ID:GiorgioRegni,项目名称:marfs,代码行数:57,代码来源:object_stream.c
示例13: mouse_multi_click2
void
mouse_multi_click2(size_t num_clicks, CGPoint point)
{
CGEventRef base_event = NEW_EVENT(
kCGEventLeftMouseDown,
point,
kCGMouseButtonLeft
);
CGEventSetIntegerValueField(base_event, kCGMouseEventClickState, num_clicks);
CHANGE(base_event, kCGEventLeftMouseDown);
POST(base_event);
CHANGE(base_event, kCGEventLeftMouseUp);
POSTRELEASE(base_event);
}
开发者ID:tbartelmess,项目名称:mouse,代码行数:16,代码来源:mouser.c
示例14: MY_ASSERT
void *filesys_new(t_symbol *sym, long argc, t_atom *argv)
{
t_filesys *x = NULL;
x = (t_filesys *)object_alloc(filesys_class);
MY_ASSERT(!x, NULL, "Object allocation failed.");
x->outl_return = bangout((t_object*)x); // Outlet 1: 0 or 1 for failure or success (int)
x->outl_mess = outlet_new((t_object*)x, NULL); // Outlet 0: General messages
_filesys_cd_patcher(x);
POST("New object created: directory: %s", x->dir_s);
return(x);
}
开发者ID:ycandau,项目名称:y.filesys,代码行数:17,代码来源:y_filesys.c
示例15: initialize_var
static
void
initialize_var(struct var *var, const char *envname)
{
PRE(var->value == NULL);
if (atf_env_has(envname)) {
const char *val = atf_env_get(envname);
if (strlen(val) > 0 || var->can_be_empty)
var->value = val;
else
var->value = var->default_value;
} else
var->value = var->default_value;
POST(var->value != NULL);
}
开发者ID:AlexZhao,项目名称:freebsd,代码行数:17,代码来源:config.c
示例16: activate
String thethingsiOClient::activate(String activationCode) {
token = "";
String body = "";
String find_token = "thingToken\":\"";
int start;
char c;
if (POST(regular_client, "/v2/things/", "{ \"activationCode\":\"" + activationCode + "\"}")) {
delay(1000);
while (regular_client->available() && (c = (char)regular_client->read()) != '{');
if (c == '{') {
while (regular_client->available() && (c = (char)regular_client->read()) != '\n') body.concat(c);
if ((start = body.indexOf(find_token)) >= 0) {
start = start + find_token.length();
token = body.substring(start, start + TOKEN_SIZE);
}
}
}
return token;
}
开发者ID:mathresearch,项目名称:thethingsio-arduino-library,代码行数:19,代码来源:thethingsiOClient.cpp
示例17: POST
void RegisterLayer::clickRegister(CCObject* pSender)
{
map<string,string> post;
post["api"] = "sign_up";
post["username"] = usernameText->getString();
post["password"] = passwordText->getString();
post["role_type"] = Utils::int2str((int)USER->getRoleType());
post["level"] = Utils::int2str(USER->getLevel());
post["exp"] = Utils::int2str(USER->getExp());
post["basic_agi"] = Utils::int2str(USER->getBasicAGI());
post["basic_str"] = Utils::int2str(USER->getBasicSTR());
post["basic_def"] = Utils::int2str(USER->getBasicDEF());
post["current_weapon"] = Utils::int2str((int)USER->getEquipment().getWeapon());
post["current_base"] = Utils::int2str((int)USER->getEquipment().getBase());
post["current_plate"] = Utils::int2str((int)USER->getEquipment().getPlate());
post["open_chapters_number"] = Utils::int2str(USER->getOpenChaptersNumber());
post["win_online_game_number"] = Utils::int2str(USER->getWinOnlineGamesNumber());
post["play_online_game_number"] = Utils::int2str(USER->getPlayOnlineGamesNumber());
post["money"] = Utils::int2str(USER->getMoney());
post["honor"] = Utils::int2str(USER->getHonor());
std::string jsonStr = POST(post);
JsonBox::Value data;
CCLOG(jsonStr.c_str());
data.loadFromString(jsonStr);
if(data["result"].getString()=="OK"){
USER->setUsername(usernameText->getString());
USER->setPassword(passwordText->getString());
USER->setHasSignin(true);
USER->setIsBeginner(false);
CCNode* parent = this->getParent();
this->removeFromParentAndCleanup();
INFORMATION_BOX(CN("register_and_login_successfully"),parent);
}
else if(data["result"].getString()=="Username existed"){
INFORMATION_BOX(CN("username_existed"),this);
}
else{
INFORMATION_BOX(CN("register_failed"),this);
}
}
开发者ID:cruisehu,项目名称:PongPongPia,代码行数:42,代码来源:RegisterLayer.cpp
示例18: init_variables
//
// Adds all predefined standard build-time variables to the m_variables
// map, considering the values a user may have provided in the environment.
//
// Can only be called once during the program's lifetime.
//
static
void
init_variables(void)
{
PRE(m_variables.empty());
m_variables["atf_build_cc"] = atf_config_get("atf_build_cc");
m_variables["atf_build_cflags"] = atf_config_get("atf_build_cflags");
m_variables["atf_build_cpp"] = atf_config_get("atf_build_cpp");
m_variables["atf_build_cppflags"] = atf_config_get("atf_build_cppflags");
m_variables["atf_build_cxx"] = atf_config_get("atf_build_cxx");
m_variables["atf_build_cxxflags"] = atf_config_get("atf_build_cxxflags");
m_variables["atf_includedir"] = atf_config_get("atf_includedir");
m_variables["atf_libexecdir"] = atf_config_get("atf_libexecdir");
m_variables["atf_pkgdatadir"] = atf_config_get("atf_pkgdatadir");
m_variables["atf_shell"] = atf_config_get("atf_shell");
m_variables["atf_workdir"] = atf_config_get("atf_workdir");
POST(!m_variables.empty());
}
开发者ID:0xbda2d2f8,项目名称:freebsd,代码行数:26,代码来源:config.cpp
示例19: all
/**
all (sym: dictionary)
*/
void dict_recurse_all(t_dict_recurse *x, t_symbol *dict_sym)
{
TRACE("dict_recurse_all");
// Initialize the object variables
x->command = CMD_ALL;
t_atom dict_ato[1];
atom_setsym(dict_ato, dict_sym);
if (_dict_recurse_begin_cmd(x, dict_ato, gensym("all")) != ERR_NONE) { return; }
// Start the recursion
_dict_recurse_dict(x, x->dict, 0);
// Post a summary for the command
POST("all: %i reference%s found in \"%s\".", x->count, (x->count == 1) ? "" : "s", x->dict_sym->s_name);
// End the command
_dict_recurse_end_cmd(x);
}
开发者ID:ycandau,项目名称:dict.recurse,代码行数:23,代码来源:dict.recurse.c
示例20: POST
void LogIntoLayer::clickLogInto(CCObject* pSender)
{
map<string,string> post;
post["api"] = "login";
post["username"]=usernameText->getString();
post["password"]=passwordText->getString();
std::string jsonStr = POST(post);
JsonBox::Value data;
CCLOG(jsonStr.c_str());
data.loadFromString(jsonStr);
if(data["result"].getString()=="OK"){
CCLOG("Login Successfully!");
USER->setUserID(atoi(data["0"]["user_id"].getString().c_str()));
USER->setUsername(data["0"]["username"].getString());
USER->setPassword(data["0"]["password"].getString());
USER->setLevel(atoi(data["0"]["level"].getString().c_str()));
USER->setExp(atoi(data["0"]["exp"].getString().c_str()));
USER->setBasicAGI(atoi(data["0"]["basic_agi"].getString().c_str()));
USER->setBasicSTR(atoi(data["0"]["basic_str"].getString().c_str()));
USER->setBasicDEF(atoi(data["0"]["basic_def"].getString().c_str()));
Equipment* equipment = new Equipment();
equipment->setWeapon(Weapon(atoi(data["0"]["current_weapon"].getString().c_str())));
equipment->setBase(Base(atoi(data["0"]["current_base"].getString().c_str())));
equipment->setPlate(Plate(atoi(data["0"]["current_plate"].getString().c_str())));//
USER->setOpenChaptersNumber(atoi(data["0"]["open_chapters_number"].getString().c_str()));
USER->setWinOnlineGamesNumber(atoi(data["0"]["win_online_game_number"].getString().c_str()));
USER->setPlayOnlineGamesNumber(atoi(data["0"]["play_online_game_number"].getString().c_str()));
USER->setMoney(atoi(data["0"]["money"].getString().c_str()));
CCLOG(data["0"]["money"].getString().c_str());
USER->setHonor(atoi(data["0"]["honor"].getString().c_str()));
USER->setHasSignin(true);
USER->setIsBeginner(false);
USER->flush();
CCNode* parent = this->getParent();
this->removeFromParentAndCleanup();
INFORMATION_BOX("Login successfully!",parent);
}
else{
PopWindowsLayer::createInfomationBox("Login failed!",this);
}
}
开发者ID:cruisehu,项目名称:PongPongPia,代码行数:41,代码来源:LogIntoLayer.cpp
注:本文中的POST函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论