コード例 #1
0
void VLocalizationGroupHandler::SetAttribute(const VString& inName, const VString& inValue)
{
	if (fGroupBag == NULL)
		fGroupBag = new VValueBag;

	if (inName.EqualToUSASCIICString( "id"))
	{
		sLONG idValue = inValue.GetLong();
		if (idValue != 0)
			fGroupID = idValue;
		//else
			//DebugMsg( "VLocalizationGroupHandler::Non-valid group id Value : %S\n", &inValue);
	}	
	else if (inName.EqualToUSASCIICString( "resname"))
	{
		if (!inValue.IsEmpty())
		{
			fGroupResnamesStack.top() = inValue;
		}
	}
	else if (inName.EqualToUSASCIICString( "restype"))
	{
		xbox_assert( fGroupRestype.IsEmpty() );	// no nested group
		fGroupRestype = inValue;
	}

	if (fGroupBag != NULL)
		fGroupBag->SetAttribute( inName, inValue);
}
コード例 #2
0
void VLocalizationTransUnitHandler::SetAttribute( const VString& inName, const VString& inValue)
{
	if (fTransUnitBag != NULL)
	{
		fTransUnitBag->SetString( inName, inValue);
	}
	
	if (inName.EqualToUSASCIICString( "id"))
	{
		sLONG idValue = inValue.GetLong();
		if (idValue > 0)
			fStringID = (uLONG)idValue;
		//else
			//DebugMsg("VLocalizationTransUnitHandler::Non-valid trans-unit id Value : %S\n", &inValue);
	}
	else if (inName.EqualToUSASCIICString( "resname"))
	{
		fResName = inValue;
	}
	else if (inName.EqualToUSASCIICString( "d4:excludeIf"))
	{
		CheckPlatformTag( inValue, false, &fExcluded);
	}
	else if (inName.EqualToUSASCIICString( "d4:includeIf"))
	{
		CheckPlatformTag( inValue, true, &fExcluded);
	}
}
コード例 #3
0
/*
	IMPORTANT:	the build version is created on the compilation machine. It requires that (1) perl is installed and (2) an external file contains the number.
				That's why if you compile 4D on your computer, you'll probably always get a build version of 0 (if the external file is not found, "00000" is used)
*/
sLONG VProcess::GetChangeListNumber() const
{
	sLONG changeListNumber = 0;
	VString s;
	GetBuildNumber( s);
	VIndex pos = s.FindUniChar( '.', s.GetLength(), true);
	if (pos > 0)
	{
		s.SubString( pos + 1, s.GetLength() - pos);
		changeListNumber = s.GetLong();
	}
	return changeListNumber;
}
コード例 #4
0
void VSpanHandler::SetHTMLAttribute(const VString& inName, const VString& inValue)
{
	//here we need to parse only mandatory font attributes
	if (inName.EqualToString("face"))
		SetFont(inValue);
	else if (inName.EqualToString("color"))
		SetColor( inValue);
	else if (inName.EqualToString("bgcolor"))
		SetBackgroundColor( inValue);
	else if (inName.EqualToString("size"))
	{
		//HTML font size is a number from 1 to 7; default is 3
		sLONG size = inValue.GetLong();
		if (size >= 1 && size <= 7)
		{
			size = size*12/3; //convert to point
			VString fontSize;
			fontSize.FromLong(size);
			SetFontSize( fontSize, 72.0f);
		}
	}
}