本文整理汇总了C++中PushString函数的典型用法代码示例。如果您正苦于以下问题:C++ PushString函数的具体用法?C++ PushString怎么用?C++ PushString使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PushString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
};
}
示例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);
}
示例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;
}
示例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.
}
示例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);
}
示例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);
}
示例7: prim_version
void
prim_version(PRIM_PROTOTYPE)
{
CHECKOP(0);
CHECKOFLOW(1);
PushString(VERSION);
}
示例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);
}
示例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);
}
示例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;
}
示例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());
}
示例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);
}
示例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;
}
}
示例14: prim_version
void
prim_version(PRIM_PROTOTYPE)
{
char temp[256];
CHECKOP(0);
CHECKOFLOW(1);
sprintf(temp, "%s(ProtoMUCK%s)", VERSION, PROTOBASE);
PushString(temp);
}
示例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;
}