Row & Row :: AppendRow( const Row & row ) { if ( mRep == row.mRep ) { // self append vector <string> tmp( mRep->Values() ); // must be from copy for ( unsigned int i = 0; i < tmp.size(); i++ ) { AppendValue( tmp[i] ); } } else { // normal append for ( unsigned int i = 0; i < row.Size(); i++ ) { AppendValue( row[i] ); } } return *this; }
//============================================================================ // NCFArray::SetObject : Set the object. //---------------------------------------------------------------------------- bool NCFArray::SetObject(CFArrayRef cfObject, bool takeOwnership) { NCFObject theObject(cfObject, takeOwnership); CFIndex n, numItems; NVariant theValue; bool isValid; // Get the state we need isValid = (cfObject != NULL); Clear(); // Set the object if (isValid) { numItems = CFArrayGetCount(cfObject); for (n = 0; n < numItems; n++) { theValue = NMacTarget::ConvertCFToObject(CFArrayGetValueAtIndex(cfObject, n)); AppendValue(theValue); } } return(isValid); }
VectorValue* CPropHelper::CreateAngle3 (PropItemVec& items, shared_str key, Fvector* val, float mn, float mx, float inc, int decim) { VectorValue* V = (VectorValue*) AppendValue (items,key,xr_new<VectorValue>(val,mn,mx,inc,decim),PROP_VECTOR); V->OnAfterEditEvent.bind (this,&CPropHelper::FvectorRDOnAfterEdit); V->OnBeforeEditEvent.bind (this,&CPropHelper::FvectorRDOnBeforeEdit); V->Owner()->OnDrawTextEvent.bind(this,&CPropHelper::FvectorRDOnDraw); return V; }
FloatValue* CPropHelper::CreateAngle (PropItemVec& items, shared_str key, float* val, float mn, float mx, float inc, int decim) { FloatValue* V = (FloatValue*) AppendValue (items,key,xr_new<FloatValue>(val,mn,mx,inc,decim),PROP_NUMERIC); V->OnAfterEditEvent.bind (this,&CPropHelper::floatRDOnAfterEdit); V->OnBeforeEditEvent.bind (this,&CPropHelper::floatRDOnBeforeEdit); V->Owner()->OnDrawTextEvent.bind(this,&CPropHelper::floatRDOnDraw); return V; }
int OperationNode::Evaluate(const mtlChars &dst, mtlString &out, int lane, int depth) { int ldepth = left->Evaluate(dst, out, lane, depth); int rdepth = right->IsLeaf() ? 0 : right->Evaluate(dst, out, lane, depth+1); int mdepth = 0; mtlString addr_str; if (depth > 0 || dst.GetSize() == 0) { out.Append('['); addr_str.FromInt(depth); out.Append(addr_str); out.Append(']'); mdepth = depth; } else { mtlString temp; GetLane(dst, lane, temp); out.Append(temp); //out.Append(dst); } AppendValue(out); out.Append('='); if (right->IsLeaf()) { right->AppendValue(out); } else { addr_str.FromInt(depth+1); out.Append('['); out.Append(addr_str); out.Append(']'); } out.Append(';'); return mmlMax(ldepth, mdepth, rdepth); }
ButtonValue* CPropHelper::CreateButton (PropItemVec& items, shared_str key, shared_str val, u32 flags, ButtonValue::TOnBtnClick onClick) { PropValue* PV = AppendValue (items,key,xr_new<ButtonValue>(val,flags),PROP_BUTTON); ButtonValue* BV = dynamic_cast<ButtonValue*>(PV); BV->OnBtnClickEvent = onClick; return BV; // return (ButtonValue*) AppendValue (items,key,xr_new<ButtonValue>(val,flags),PROP_BUTTON); }
void AppendValues(TOrderedMap Values) { std::list<TString> orderedKeys = Helpers::GetOrderedKeysFromMap(Values); for (std::list<TString>::const_iterator iterator = orderedKeys.begin(); iterator != orderedKeys.end(); iterator++) { TString name = *iterator; TValueIndex value = Values[name]; AppendValue(name, value.value); } }
//--------------------------------------------------------------------------- ChooseValue* CPropHelper::CreateChoose (PropItemVec& items, shared_str key, shared_str* val, u32 mode, LPCSTR path, void* fill_param, u32 sub_item_count, u32 choose_flags) { ChooseValue* cv = (ChooseValue*)AppendValue (items,key,xr_new<ChooseValue>(val,mode,path,fill_param,sub_item_count,choose_flags),PROP_CHOOSE); SChooseEvents* E= TfrmChoseItem::GetEvents(mode); if (E&&!E->on_thm.empty()){ cv->Owner()->m_Flags.set(PropItem::flDrawThumbnail,TRUE); cv->OnDrawThumbnailEvent = E->on_thm; } return cv; }
JavaOptions() { FOptions = NULL; #ifndef USE_JLI_LAUNCH #ifdef DEBUG Platform& platform = Platform::GetInstance(); if (platform.GetDebugState() == Platform::dsNative) { AppendValue(_T("vfprintf"), _T(""), (void*)vfprintfHook); } #endif //DEBUG #endif //USE_JLI_LAUNCH }
nsresult mozSqlResultMysql::AppendKeys(Row* aRow, nsAutoString& aKeys) { PRInt32 i; for (i = 0; i < mColumnInfo.Count(); i++) { if (((ColumnInfo*)mColumnInfo[i])->mIsPrimaryKey){ if (i){ aKeys.Append(NS_LITERAL_STRING(" AND ")); } aKeys.Append(((ColumnInfo*)mColumnInfo[i])->mName); aKeys.Append(PRUnichar('=')); Cell* cell = aRow->mCells[i]; AppendValue(cell, aKeys); } } return NS_OK; }
CanvasValue* CPropHelper::CreateCanvas (PropItemVec& items, shared_str key, shared_str val, int height) { return (CanvasValue*) AppendValue (items,key,xr_new<CanvasValue>(val,height),PROP_CANVAS); }
ColorValue* CPropHelper::CreateFColor (PropItemVec& items, shared_str key, Fcolor* val) { return (ColorValue*) AppendValue (items,key,xr_new<ColorValue>(val),PROP_FCOLOR); }
U32Value* CPropHelper::CreateColor (PropItemVec& items, shared_str key, u32* val) { return (U32Value*) AppendValue (items,key,xr_new<U32Value>(val,0x00000000,0xffffffff,1,0),PROP_COLOR);}
U8Value* CPropHelper::CreateU8 (PropItemVec& items, shared_str key, u8* val, u8 mn, u8 mx, u8 inc) { return (U8Value*) AppendValue (items,key,xr_new<U8Value>(val,mn,mx,inc,0),PROP_NUMERIC); }
CListValue* CPropHelper::CreateCList (PropItemVec& items, shared_str key, LPSTR val, u32 sz, xr_string* lst, u32 cnt) { return (CListValue*) AppendValue (items,key,xr_new<CListValue>(val,sz,lst,cnt),PROP_CLIST); }
void AppendValue(const TString Key, TString Value) { AppendValue(Key, Value, NULL); }
Token32Value* CPropHelper::CreateToken32 (PropItemVec& items, shared_str key, u32* val, xr_token* token) { return (Token32Value*) AppendValue (items,key,xr_new<Token32Value>(val,token),PROP_TOKEN); }
CTextValue* CPropHelper::CreateTexture (PropItemVec& items, shared_str key, LPSTR val, u32 sz) { return (CTextValue*) AppendValue (items,key,xr_new<CTextValue>(val,sz),PROP_TEXTURE2); }
VectorValue* CPropHelper::CreateVector (PropItemVec& items, shared_str key, Fvector* val, float mn, float mx, float inc, int decim) { return (VectorValue*) AppendValue (items,key,xr_new<VectorValue>(val,mn,mx,inc,decim),PROP_VECTOR); }
BOOLValue* CPropHelper::CreateBOOL (PropItemVec& items, shared_str key, BOOL* val) { return (BOOLValue*) AppendValue (items,key,xr_new<BOOLValue>(val),PROP_BOOLEAN); }
FloatValue* CPropHelper::CreateFloat (PropItemVec& items, shared_str key, float* val, float mn, float mx, float inc, int decim) { return (FloatValue*) AppendValue (items,key,xr_new<FloatValue>(val,mn,mx,inc,decim),PROP_NUMERIC); }
U32Value* CPropHelper::CreateU32 (PropItemVec& items, shared_str key, u32* val, u32 mn, u32 mx, u32 inc) { return (U32Value*) AppendValue (items,key,xr_new<U32Value>(val,mn,mx,inc,0),PROP_NUMERIC); }
U16Value* CPropHelper::CreateU16 (PropItemVec& items, shared_str key, u16* val, u16 mn, u16 mx, u16 inc) { return (U16Value*) AppendValue (items,key,xr_new<U16Value>(val,mn,mx,inc,0),PROP_NUMERIC); }
/* static */ OP_STATUS JS_Console::FormatString(ES_Value* argv, int argc, OpString &str) { if (argc == 0) return OpStatus::OK; // Holds the formatted string. TempBuffer buf; // The argument which will be stringified next. int argument = 0; // If the first argument is a string, check if it contains placeholders. if (argv[0].type == VALUE_STRING) { // The first argument is the format string. It may or may not contain // formatting placeholders (%). const uni_char *placeholder = argv[0].value.string; const uni_char *stored = placeholder; // Skip the formatting string. ++argument; while ((placeholder = uni_strchr(placeholder, '%')) != NULL) { // Calculate the length until the '%'. int length = (placeholder - stored); // Skip the '%', and check that 'placeholder' now points to // a supported character. if (!JS_Console::IsSupportedPlaceholder(++placeholder)) continue; // Append everything up until the '%'. if (length > 0) RETURN_IF_ERROR(buf.Append(stored, length)); // If the character after the first '%' is another '%', then output // a single '%'. if (*placeholder == '%') RETURN_IF_ERROR(buf.Append("%")); // Otherwise, append the string representation of the ES_Value. else if (argument < argc) RETURN_IF_ERROR(JS_Console::AppendValue(argv[argument++], buf)); // Or, if we don't have more arguments, output the original placeholder. else RETURN_IF_ERROR(buf.Append(placeholder - 1, 2)); // Skip the character following the %, but only if not at the // end of string. if (*placeholder != '\0') ++placeholder; stored = placeholder; } // Append the rest of the formatting string, if any. if (*stored != '\0') RETURN_IF_ERROR(buf.Append(stored)); } // If we have more arguments, append them in a space delimited list. while (argument < argc) { // Never start a string with a space. if (argument > 0) RETURN_IF_ERROR(buf.Append(" ")); RETURN_IF_ERROR(AppendValue(argv[argument++], buf)); } return str.Set(buf.GetStorage()); }
RToken32Value* CPropHelper::CreateRToken32 (PropItemVec& items, shared_str key, u32* val, xr_rtoken* token, u32 t_cnt) { return (RToken32Value*)AppendValue (items,key,xr_new<RToken32Value>(val,token,t_cnt),PROP_RTOKEN); }
TokenValueSH* CPropHelper::CreateTokenSH (PropItemVec& items, shared_str key, u32* val, const TokenValueSH::Item* lst, u32 cnt) { return (TokenValueSH*) AppendValue (items,key,xr_new<TokenValueSH>(val,lst,cnt),PROP_SH_TOKEN); }
CaptionValue* CPropHelper::CreateCaption (PropItemVec& items, shared_str key, shared_str val) { return (CaptionValue*) AppendValue (items,key,xr_new<CaptionValue>(val),PROP_CAPTION); }
RListValue* CPropHelper::CreateRList (PropItemVec& items, shared_str key, shared_str* val, shared_str* lst, u32 cnt) { return (RListValue*) AppendValue (items,key,xr_new<RListValue>(val,lst,cnt),PROP_RLIST); }
Flag32Value* CPropHelper::CreateFlag32 (PropItemVec& items, shared_str key, Flags32* val, u32 mask, LPCSTR c0, LPCSTR c1, u32 flags) { return (Flag32Value*) AppendValue (items,key,xr_new<Flag32Value>(val,mask,c0,c1,flags),PROP_FLAG); }
S8Value* CPropHelper::CreateS8 (PropItemVec& items, shared_str key, s8* val, s8 mn, s8 mx, s8 inc) { return (S8Value*) AppendValue (items,key,xr_new<S8Value>(val,mn,mx,inc,0),PROP_NUMERIC); }