Example #1
0
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;
}
Example #2
0
//============================================================================
//		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);
}
Example #3
0
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;					
}
Example #4
0
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;						
}
Example #5
0
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);
}
Example #6
0
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);
        }
    }
Example #8
0
//---------------------------------------------------------------------------
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;
}
Example #11
0
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);  			}
Example #12
0
ColorValue*		CPropHelper::CreateFColor	(PropItemVec& items, shared_str key, Fcolor* val)
{   return		(ColorValue*)	AppendValue	(items,key,xr_new<ColorValue>(val),PROP_FCOLOR);        			}
Example #13
0
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);}
Example #14
0
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);   		}
Example #15
0
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);
 }
Example #17
0
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);				}
Example #18
0
CTextValue* 	CPropHelper::CreateTexture	(PropItemVec& items, shared_str key, LPSTR val, u32 sz)
{   return		(CTextValue*)	AppendValue	(items,key,xr_new<CTextValue>(val,sz),PROP_TEXTURE2);        				}
Example #19
0
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);	}
Example #20
0
BOOLValue* 	  	CPropHelper::CreateBOOL		(PropItemVec& items, shared_str key, BOOL* val)
{   return		(BOOLValue*)	AppendValue	(items,key,xr_new<BOOLValue>(val),PROP_BOOLEAN);        			}
Example #21
0
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);	}
Example #22
0
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);			}
Example #23
0
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); 		}
Example #24
0
/* 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());
}
Example #25
0
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);		}
Example #26
0
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);		}
Example #27
0
CaptionValue*  	CPropHelper::CreateCaption	(PropItemVec& items, shared_str key, shared_str val)
{	return	   	(CaptionValue*)	AppendValue	(items,key,xr_new<CaptionValue>(val),PROP_CAPTION);					}
Example #28
0
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);       		}
Example #29
0
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);    }
Example #30
0
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);			}