本文整理汇总了C++中PushString函数的典型用法代码示例。如果您正苦于以下问题:C++ PushString函数的具体用法?C++ PushString怎么用?C++ PushString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PushString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: PushInt
CSpace::CSpace(int64 ParentID, int64 ChildID)
:m_ValidateModule(NULL),m_PrivateValidata(NULL)
{
m_ID = -1; //ParentID
PushInt(-1); //Space ID
PushString(_T("")); //Space Name
PushInt(LOCAL_SPACE);//Space Type
tstring Fingerprint;
PushString(Fingerprint); //Space Fingerprint
ePipeline Property;
CreateDefaultProerty(Property); //Space Property;
PushPipe(Property);
ePipeline OwnerInfo;
CreateDefaultOwnerInfo(OwnerInfo); //Space OwnerList
PushPipe(OwnerInfo);
if(!Load(ParentID,ChildID)){
m_ID = -1;
};
}
开发者ID:GMIS,项目名称:GMIS,代码行数:26,代码来源:Space.cpp
示例2: INIT_PUSH
/*
** email address obfuscation
*/
char *obfuscate_email_address(char *address)
{
char sbuf[10];
struct Push buf;
int at_mailbox=1;
char *sentinel;
if (!set_email_address_obfuscation){
return address;
}
sentinel=strlen(address)+address;
INIT_PUSH(buf);
while (address<sentinel){
if (*address=='@'){
PushString(&buf,"@");
at_mailbox=0;
}else{
if(!at_mailbox){
sprintf(sbuf,"&#%04d;",*address);
PushString(&buf,sbuf);
}else{
sbuf[0]=*address;
sbuf[1]=0x0;
PushString(&buf,sbuf);
}
}
address++;
}
RETURN_PUSH(buf);
}
开发者ID:pbevin,项目名称:hypermail,代码行数:35,代码来源:string.c
示例3: PushString
int LuaScriptUtilities::PushStringAttribute(
lua_State* const luaVM,
const Ogre::String attributeValue,
const Ogre::String attributeName,
const int tableIndex)
{
PushString(luaVM, attributeName);
PushString(luaVM, attributeValue);
lua_settable(luaVM, tableIndex);
return 1;
}
开发者ID:Bewolf2,项目名称:LearningGameAI,代码行数:11,代码来源:LuaScriptUtilities.cpp
示例4: OnGet
/*
* Manual page at function.def
*/
INT16 CGEN_PUBLIC CFunction::OnGet()
{
// Delegate to running function // ------------------------------------
FNC_DELEGATE OnGet(); // Use a weird macro (see function.def)
// Initialize // ------------------------------------
CDlpObject* iCont = GetActiveInstance(); // Determine field container
const char* lpsId = GetNextToken(TRUE); // Determine field name
// Validate // ------------------------------------
DLPASSERT(iCont); // Check set target
if (!dlp_strlen(lpsId)) // If no field name committed
return IERROR(this,FNC_EXPECT,"field identifier after -get",0,0); // Error
SWord* lpWrd = iCont->FindWord(lpsId,WL_TYPE_FIELD); // Find field in container
if (!lpWrd) // If not found
{ // >>
iCont = this; // Use this instance as container
lpWrd = FindWord(lpsId,WL_TYPE_FIELD); // And seek again
} // <<
if (!lpWrd) return IERROR(this,ERR_NOTFIELD,lpsId,0,0); // If still not found --> Error
// Push field value // ------------------------------------
switch (lpWrd->ex.fld.nType) // Branch for field variable type
{ // >>
case T_BOOL : { PushLogic ( *( BOOL*)lpWrd->lpData); break; }// - Boolean
case T_UCHAR : { PushNumber (CMPLX(*( UINT8*)lpWrd->lpData)); break; }// - Unsigned character
case T_CHAR : { PushNumber (CMPLX(*( INT8*)lpWrd->lpData)); break; }// - Signed character
case T_USHORT : { PushNumber (CMPLX(*( UINT16*)lpWrd->lpData)); break; }// - Unsigned short integer
case T_SHORT : { PushNumber (CMPLX(*( INT16*)lpWrd->lpData)); break; }// - Signed short integer
case T_UINT : { PushNumber (CMPLX(*( UINT32*)lpWrd->lpData)); break; }// - Unsigned integer
case T_INT : { PushNumber (CMPLX(*( INT32*)lpWrd->lpData)); break; }// - Signed integer
case T_ULONG : { PushNumber (CMPLX(*( UINT64*)lpWrd->lpData)); break; }// - Unsigned long integer
case T_LONG : { PushNumber (CMPLX(*( INT64*)lpWrd->lpData)); break; }// - Signed long integer
case T_FLOAT : { PushNumber (CMPLX(*( FLOAT32*)lpWrd->lpData)); break; }// - Single precision floating point
case T_DOUBLE : { PushNumber (CMPLX(*( FLOAT64*)lpWrd->lpData)); break; }// - Double precision floating point
case T_COMPLEX : { PushNumber ( *(COMPLEX64*)lpWrd->lpData); break; }// - Double precision complex floating point
case T_INSTANCE: { PushInstance(*(CDlpObject**) lpWrd->lpData); break; }// - Instance
case T_TEXT : /* Fall through */ // - Text (deprecated type!)
case T_CSTRING : /* Fall through */ // - Constant string
case T_STRING : { PushString(*(char**) lpWrd->lpData); break; }// - String
default : { // - Other types
if (lpWrd->ex.fld.nType > 0 && lpWrd->ex.fld.nType <= 256) // Character array?
PushString((char*)lpWrd->lpData); // Push value
else // Type unknown!
DLPASSERT(FMSG("Unknown field type")); // Error
} // <<
} // <<
return O_K; // Done.
}
开发者ID:gitgun,项目名称:dLabPro,代码行数:53,代码来源:fnc_iam.cpp
示例5: Std_Joinchars
void Std_Joinchars(VM* vm)
{
Object* obj = PopArrayObject(vm);
if(obj->array.length == 0)
{
PushString(vm, "");
return;
}
char* str = alloca(obj->array.length + 1);
for(int i = 0; i < obj->array.length; ++i)
str[i] = (char)obj->array.members[i]->number;
str[obj->array.length] = '\0';
PushString(vm, str);
}
开发者ID:nexusj,项目名称:mint-lang,代码行数:15,代码来源:vm.c
示例6: prim_timefmt
void
prim_timefmt(PRIM_PROTOTYPE)
{
time_t lt = 0;
CHECKOP(2);
oper2 = POP(); /* integer: time */
oper1 = POP(); /* string: format */
if (oper1->type != PROG_STRING)
abort_interp("Invalid argument (1)");
if (!oper1->data.string)
abort_interp("Illegal NULL string (1)");
if (oper2->type != PROG_INTEGER)
abort_interp("Invalid argument (2)");
lt = (time_t) oper2->data.number;
time_tm = localtime(<);
if (!time_tm)
abort_interp("Out of range time argument");
if (!strftime(buf, BUFFER_LEN, oper1->data.string->data, time_tm))
abort_interp("Operation would result in overflow.");
CHECKOFLOW(1);
CLEAR(oper1);
CLEAR(oper2);
PushString(buf);
}
开发者ID:foxbird,项目名称:fuzzball,代码行数:25,代码来源:p_misc.c
示例7: prim_version
void
prim_version(PRIM_PROTOTYPE)
{
CHECKOP(0);
CHECKOFLOW(1);
PushString(VERSION);
}
开发者ID:hyena,项目名称:fuzzball,代码行数:7,代码来源:p_stack.c
示例8: OutNvramStack
void OutNvramStack(void)
{
InitPushCRC();
uint i;
for (i=0; i<4000; i++) PushChar(0);
InitPushCRC();
PUSH_VALUE(NVRAM_BEGIN)
PUSH_VALUE(NVRAM_END)
PUSH_VALUE(dwNVRAM_BYTES)
PushChar(0x0D); PushChar(0x0A);
PushLongAsString((ulong)100*(NVRAM_END-NVRAM_BEGIN)/(dwNVRAM_BYTES-NVRAM_BEGIN));
PushString("%");
PushChar(0x0D); PushChar(0x0A);
PushChar(0x0D); PushChar(0x0A);
#include "../generated/out_nvram.txt"
Output(4000);
}
开发者ID:ti-cortex-m4,项目名称:tm4c1294ncpdt,代码行数:25,代码来源:out_nvram_stack.c
示例9: Std_Tostring
void Std_Tostring(VM* vm)
{
Object* obj = PopObject(vm);
char buf[128];
switch(obj->type)
{
case OBJ_NULL: sprintf(buf, "null"); break;
case OBJ_STRING: PushString(vm, obj->string.raw); return;
case OBJ_NUMBER: sprintf(buf, "%g", obj->number); break;
case OBJ_ARRAY: sprintf(buf, "array(%i)", obj->array.length); break;
case OBJ_FUNC: sprintf(buf, "func %s", obj->func.isExtern ? vm->externNames[obj->func.index] : vm->functionNames[obj->func.index]); break;
case OBJ_DICT: sprintf(buf, "dict(%i)", obj->dict.numEntries); break;
}
PushString(vm, buf);
}
开发者ID:nexusj,项目名称:mint-lang,代码行数:16,代码来源:vm.c
示例10: Load
unsigned int Load(const char* filename)
{
_origin.clear();
_origin_rev.clear();
_max_id = 0;
const std::string header("String #");
const std::string header_next(" is ");
const char splitter = '~';
std::ifstream fin(filename);
std::string line;
unsigned int index = INDEX_INVALID;
std::string content;
std::stringstream ss(content);
while(std::getline(fin, line))
{
//not including the \n
if( line.length() >= header.length() &&
line.substr(0, header.length()) == header)
{
if(index != INDEX_INVALID)
{
PushString(ss, splitter, index);
}
int pos = line.find_first_of(splitter);
std::string index_str = line.substr(header.length(), pos - header_next.length() - header.length());
index = atoi(index_str.c_str());
ss << line.substr(pos + 1);
}
else if(index != INDEX_INVALID)
{
ss << std::endl;
ss << line;
}
}
if(index != INDEX_INVALID)
{
PushString(ss, splitter, index);
}
return _max_id;
}
开发者ID:fantasydr,项目名称:nwn2dev,代码行数:47,代码来源:UpdateModTemplates.cpp
示例11: PushString
void PushString( std::stringstream &ss, const char splitter, unsigned int index )
{
std::string result = ss.str();
int splitter_pos = result.find_last_of(splitter);
PushString(index, splitter_pos < 0 ? result : result.substr(0, splitter_pos));
ss.str(std::string());
}
开发者ID:fantasydr,项目名称:nwn2dev,代码行数:8,代码来源:UpdateModTemplates.cpp
示例12: INIT_PUSH
static char *msgsperfolder_label(char *frmptr, int subdir_no)
{
register char *aptr;
char dtstr[DATESTRLEN];
char c;
struct Push buff;
INIT_PUSH(buff);
aptr = frmptr;
while ((c = *aptr++)) {
if (c == '%') {
switch (*aptr++) {
case '%': /* Add the % character */
PushByte(&buff, '%');
continue;
case 'd': /* directory number, starting at 0 */
sprintf(dtstr, "%d", subdir_no);
PushString(&buff, dtstr);
continue;
case 'D': /* directory number, starting with 1 */
sprintf(dtstr, "%d", subdir_no + 1);
PushString(&buff, dtstr);
continue;
case 'm': /* number of first message in directory */
sprintf(dtstr, "%d", set_msgsperfolder * subdir_no);
PushString(&buff, dtstr);
continue;
case 'M': /* number of last message possible */
sprintf(dtstr, "%d", set_msgsperfolder * (subdir_no + 1) - 1);
PushString(&buff, dtstr);
continue;
default:
PushString(&buff, "%?");
continue;
} /* end switch */
}
PushByte(&buff, c);
} /* end while */
RETURN_PUSH(buff);
}
开发者ID:LeoNelson,项目名称:hypermail,代码行数:45,代码来源:file.c
示例13: WebSocketTickInternal
void ICACHE_FLASH_ATTR WebSocketTickInternal()
{
switch( curhttp->state_deets )
{
case 4: //Has key full HTTP header, etc. wants response.
START_PACK;
PushString( "HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: " );
PushString( curhttp->pathbuffer + (MAX_PATHLEN-WS_RETKEY_SIZEM1) );
PushString( "\r\n\r\n" );
EndTCPWrite( curhttp->socket );
curhttp->state_deets = 5;
curhttp->keep_alive = 0;
break;
case 5:
WebSocketTick();
break;
}
}
开发者ID:ClemRz,项目名称:colorchord,代码行数:18,代码来源:http.c
示例14: prim_version
void
prim_version(PRIM_PROTOTYPE)
{
char temp[256];
CHECKOP(0);
CHECKOFLOW(1);
sprintf(temp, "%s(ProtoMUCK%s)", VERSION, PROTOBASE);
PushString(temp);
}
开发者ID:CyberLeo,项目名称:protomuck,代码行数:10,代码来源:p_system.c
示例15: printf
/*
* Manual page at function.def
*/
INT16 CGEN_PUBLIC CFunction::Prompt(const char* lpsMessage)
{
char sBuf[L_SSTR+1];
printf(lpsMessage); printf("> ");
if(fgets(sBuf,L_SSTR,stdin) == NULL) return NOT_EXEC;
for (char* tx = &sBuf[dlp_strlen(sBuf)-1]; *tx; tx--)
if (*tx=='\n' || *tx=='\r') *tx='\0';
else break;
PushString(sBuf);
return O_K;
}
开发者ID:gitgun,项目名称:dLabPro,代码行数:14,代码来源:fnc_iam.cpp
示例16: prim_nextprop
void
prim_nextprop(PRIM_PROTOTYPE)
{
/* dbref pname -- pname */
char *pname;
char exbuf[BUFFER_LEN];
CHECKOP(2);
oper2 = POP(); /* pname */
oper1 = POP(); /* dbref */
if (mlev < 3)
abort_interp("Permission denied.");
if (oper2->type != PROG_STRING)
abort_interp("String required. (2)");
if (oper1->type != PROG_OBJECT)
abort_interp("Dbref required. (1)");
if (!valid_object(oper1))
abort_interp("Invalid dbref. (1)");
ref = oper1->data.objref;
(void) strcpyn(buf, sizeof(buf), DoNullInd(oper2->data.string));
CLEAR(oper1);
CLEAR(oper2);
{
char *tmpname;
pname = next_prop_name(ref, exbuf, sizeof(exbuf), buf);
#ifdef LOG_PROPS
log2file("props.log", "#%d (%d) NEXTPROP: o=%d n=\"%s\" on=\"%s\"",
program, pc->line, ref, pname, buf);
#endif
while (pname && !prop_read_perms(ProgUID, ref, pname, mlev)) {
tmpname = next_prop_name(ref, exbuf, sizeof(exbuf), pname);
#ifdef LOG_PROPS
log2file("props.log", "#%d (%d) NEXTPROP: o=%d n=\"%s\" on=\"%s\"",
program, pc->line, ref, tmpname, pname);
#endif
pname = tmpname;
}
}
if (pname) {
PushString(pname);
} else {
PushNullStr;
}
}
开发者ID:hyena,项目名称:fuzzball,代码行数:52,代码来源:p_props.c
示例17: prim_fread
void prim_fread(PRIM_PROTOTYPE)
{
FILE *fh;
char *filename;
double offset;
char tempchr[2];
int result;
CHECKOP(2);
oper1 = POP();
oper2 = POP();
if (getuid() == 0 )
abort_interp("Muck is running under root privs, file prims disabled.");
if (mlev < LBOY) abort_interp("BOY primitive only.");
if(oper1->type != PROG_INTEGER)
abort_interp("Arguement 1 is not an integer.");
if(oper1->data.number < 0 ) abort_interp("Arguement 1 is a negative number.");
if(oper2->type != PROG_STRING) abort_interp("Arguement 2 is not a string.");
if(!oper2->data.string) abort_interp("Argueemnt 2 is a null string.");
offset = oper1->data.number;
filename = oper2->data.string->data;
#ifdef SECURE_FILE_PRIMS
if (!(valid_name(filename)))
abort_interp( "Invalid file name.");
if ( strchr( filename, '$' ) == NULL )
filename = set_directory(filename);
else
filename = parse_token( filename );
if ( filename == NULL )
abort_interp( "Invalid shortcut used." );
#endif
fh = fopen(filename, "r");
if (fh == NULL) { result = 0; } else {
fseek(fh, offset, SEEK_SET);
tempchr[0] = (char) fgetc(fh);
tempchr[1] = '\0';
fclose(fh);
sprintf(buf, "%s", tempchr);
result = 1;
if(tp_log_files)
log2filetime("logs/files", "#%d by %s FREAD: %s \n", program, unparse_object(player, player), oper2->data.string->data);
if ( tempchr[0] == EOF )
result = 0;
}
CLEAR(oper1);
CLEAR(oper2);
if( result )
PushString(buf);
else
PushNullStr;
}
开发者ID:CyberLeo,项目名称:protomuck,代码行数:50,代码来源:p_file.c
示例18: prim_prettylock
void
prim_prettylock(PRIM_PROTOTYPE)
{
const char *ptr;
CHECKOP(1);
oper1 = POP(); /* lock: lock */
if (oper1->type != PROG_LOCK)
abort_interp("Invalid argument");
ptr = unparse_boolexp(ProgUID, oper1->data.lock, 1);
CHECKOFLOW(1);
CLEAR(oper1);
PushString(ptr);
}
开发者ID:CyberLeo,项目名称:protomuck,代码行数:14,代码来源:p_misc.c
示例19: prim_ftostr
void
prim_ftostr(PRIM_PROTOTYPE)
{
CHECKOP(1);
oper1 = POP();
if ( oper1->type == PROG_INTEGER )
{ oper1->type = PROG_FLOAT;
oper1->data.fnumber = oper1->data.number;
}
if (oper1->type != PROG_FLOAT)
abort_interp("Non-float argument. (1)");
sprintf(buf, "%#g", oper1->data.fnumber);
CLEAR(oper1);
PushString(buf);
}
开发者ID:CyberLeo,项目名称:protomuck,代码行数:15,代码来源:p_float.c
示例20: TestStringSizeIs
void TestStringSizeIs()
{
std::string file = "..\\Ch14\\data\\count-size";
std::vector<std::string> vec;
PushString(file, vec);
for (const auto& v : vec)
{
std::cout << v << " ";
}
std::cout << std::endl;
for (size_t i = 1; i != 10; i++)
{
StringSizeIs ssi(i);
std::cout << "The count of " << i << " size words is: " << count_if(vec.begin(), vec.end(), ssi) << std::endl;
}
}
开发者ID:zhchnchn,项目名称:ZhchnchnCodes,代码行数:18,代码来源:Exercise14.38.cpp
注:本文中的PushString函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论