// Called to parse a RCSS number declaration.
bool PropertyParserNumber::ParseValue(Property& property, const String& value, const ParameterMap& ROCKET_UNUSED_PARAMETER(parameters)) const
{
	ROCKET_UNUSED(parameters);

	// Default to a simple number.
	property.unit = Property::NUMBER;

	// Check for a unit declaration at the end of the number.
	size_t unit_pos =  value.Length();
	for (size_t i = 0; i < unit_suffixes.size(); i++)
	{
		const UnitSuffix& unit_suffix = unit_suffixes[i];

		if (value.Length() < unit_suffix.second.Length())
			continue;

		size_t test_unit_pos = value.Length() - unit_suffix.second.Length();
		if (strcasecmp(value.CString() + test_unit_pos, unit_suffix.second.CString()) == 0)
		{
			unit_pos = test_unit_pos;
			property.unit = unit_suffix.first;
			break;
		}
	}

	float float_value;
	String str_value( value.CString(), value.CString() + unit_pos );
	if (sscanf(str_value.CString(), "%f", &float_value) == 1)
	{
		property.value = Variant(float_value);
		return true;
	}

	return false;
}
String BonkEnc::Utilities::LocalizeNumber(Int64 number)
{
	String	 nString = String::FromInt(number);
	String	 retVal;
	String	 separator;

	char	*buffer_a = new char [256];
	wchar_t	*buffer_w = new wchar_t [256];

	if (Setup::enableUnicode)	GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, buffer_w, 256);
	else				GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, buffer_a, 256);

	if (Setup::enableUnicode)	separator = buffer_w;
	else				separator = buffer_a;

	delete [] buffer_a;
	delete [] buffer_w;

	for (Int i = 0; i < nString.Length(); i++)
	{
		if ((nString.Length() - i) % 3 == 0 && i > 0) retVal.Append(separator);

		retVal[retVal.Length()] = nString[i];
	}

	return retVal;
}
Example #3
0
	int RegexMatcher::Match(const String & str, int startPos)
	{
		int state = dfa->StartState;
		if (state == -1)
			return -1;
		for (int i=startPos; i<str.Length(); i++)
		{
			Word charClass = (*dfa->CharTable)[str[i]];
			if (charClass == 0xFFFF)
				return -1;
			int nextState = dfa->DFA[state][charClass];
			if (nextState == -1)
			{
				if (dfa->Tags[state]->IsFinal)
					return i-startPos;
				else
					return -1;
			}
			else
				state = nextState;
		}
		if (dfa->Tags[state]->IsFinal)
			return str.Length()-startPos;
		else
			return -1;
	}
Example #4
0
/** \brief MouseUp Callback.
 * This handles the situation where someone does a drag and drop of an item.
 * In this case we should copy it to the desired location.
 *
 * \todo Implement recursive transfer when a folder is dropped.
 */
void RemoteIconView::MouseUp( const Point& cPoint, uint32 nButtons, Message* pcData )
{
	if( pcData == NULL || m_pcServer == NULL ) {
		/* No drag & drop, or no connection */
		IconView::MouseUp( cPoint, nButtons, pcData );
		return;
	}
	StopScroll();
	
	/* We got a drag & drop. Check if it contains a local file */
	int nCount, nType;
	pcData->GetNameInfo( "file/path", &nType, &nCount );
	if( nType != T_STRING || nCount == 0 ) {
		/* Something was dropped that isn't a file. Ignore it */
		IconView::MouseUp( cPoint, nButtons, pcData );
		return;
	}
	
	/* Check if there is a directory icon under the mouse. If so, we transfer the file into that directory.
	   Otherwise, we transfer it into this directory. */
	String zDestPath = m_zPath;
	for( uint i = 0; i < GetIconCount(); i++ ) {
		if( Rect( GetIconPosition( i ), GetIconPosition( i ) + GetIconSize() ).DoIntersect( ConvertToView( cPoint ) ) ) {
			/* Found an icon under the mouse */
			RemoteIconData* pcData = (RemoteIconData*)GetIconData( i );
			if( pcData->m_cNode.IsDir() ) {
				/* Found a dir under the mouse. Add it to the destination path */
				zDestPath += "/";
				zDestPath += pcData->m_cNode.m_zName;
				break;
			}
		}
	}
	
	/* Start transferring the files */
	String zSource;
	String zDest;
	for( int i = 0; pcData->FindString( "file/path", &zSource, i ) == 0; i++ )
	{
		Path cPath( zSource );
		zDest = zDestPath;
		if( zDest.Length() > 0 && zDest[zDest.Length()-1] != '/' ) zDest += "/";
		zDest += cPath.GetLeaf();
		DEBUG( "GUI: Drag & drop %s to %s\n", zSource.c_str(), zDest.c_str() );
		
		/* Ask the Server object to start the transfer */
		/* Need to determine if it is a file or a dir first though */
		FileReference cFileRef( zSource );
		struct stat sStat;
		cFileRef.GetStat( &sStat );
		if( S_ISDIR( sStat.st_mode ) ) {
			m_pcServer->SendLocalDir( zSource, zDest );
		} else {
			m_pcServer->SendLocalFile( zSource, zDest );
		}
	}
}
Example #5
0
bool Serializer::WriteFileID(const String& value)
{
    bool success = true;
    unsigned length = Min((int)value.Length(), 4);
    
    success &= Write(value.CString(), length) == length;
    for (unsigned i = value.Length(); i < 4; ++i)
        success &= WriteByte(' ');
    return success;
}
void JSPackageWriter::WriteProtoTypeRecursive(String &source, JSBClass* klass,  Vector<JSBClass*>& written)
{
    if (written.Contains(klass))
        return;

    if (klass->GetModule()->GetDotNetModule())
        return;

    PODVector<JSBClass*>& baseClasses = klass->GetBaseClasses();

    Vector<JSBClass*>::Iterator itr = baseClasses.End() - 1 ;

    while (itr != baseClasses.Begin() - 1)
    {
        WriteProtoTypeRecursive(source, (*itr), written);
        itr--;
    }

    JSBClass* base = baseClasses.Size() ? baseClasses[0] : NULL;

    if (!klass->IsNumberArray() && klass->GetPackage() == package_)
    {
        JSBModule* module = klass->GetModule();

        String moduleGuard = module->GetModuleDefineGuard();

        if (moduleGuard.Length())
        {
            source += ToString("\n%s\n", moduleGuard.CString());
        }

        if (module->Requires("3D"))
            source += "\n#ifdef ATOMIC_3D\n";

        String packageName =  klass->GetModule()->GetPackage()->GetName();
        String basePackage =  base ? base->GetModule()->GetPackage()->GetName() : "";

        source.AppendWithFormat("   js_setup_prototype(vm, \"%s\", \"%s\", \"%s\", \"%s\", %s);\n",
                                packageName.CString(), klass->GetName().CString(),
                                base ? basePackage.CString() : "", base ? base->GetName().CString() : "",
                                klass->HasProperties() ? "true" : "false");

        if (module->Requires("3D"))
            source += "#endif\n\n";

        if (moduleGuard.Length())
        {
            source += ToString("\n#endif\n", moduleGuard.CString());
        }

    }

    written.Push(klass);

}
Example #7
0
bool datoIgualBST(tPalabra* dato,tPalabra* d){
        String c = dato->cadena;
        String e = d->cadena;
        int n = c.Length();
        for(int i = 1; i <= n;i++)
                c[i] = UpCase(c[i]);
        n = e.Length();
        for(int i = 1; i <= n;i++)
                e[i] = UpCase(e[i]);
        return e == c;
}
Example #8
0
uint32 Font::GetTextWidth(const String& text) const
{
	uint32 width = 0;

	if (_glyphs.Size() > 0)
	{
		for (int i = 0; i < text.Length(); i++)
			width = width + _glyphs[(unsigned char)text[i]].GetFinX() - _glyphs[(unsigned char)text[i]].GetIniX();
	}
	else
		width = text.Length() * Image::GetWidth();

	return width;
}
Example #9
0
	const String String::operator+=(const String& s){
		if (sizeMemory < Length() + s.Length() + 1)
		{
			char *tmp = new char[sizeMemory];
			strcpy_s(tmp, sizeMemory, strng);

			sizeMemory = Length() + s.Length() + 1;
			NewString(sizeMemory);
			strcpy_s(strng, sizeMemory, tmp);
			delete[] tmp;
		}
		strcat_s(strng, sizeMemory, s.strng);
		return *this;
	}
Example #10
0
void JSONValue::WriteIndent(String& dest, int indent)
{
    uint oldLength = dest.Length();
    dest.Resize(oldLength + indent);
    for (int i = 0; i < indent; ++i)
        dest[oldLength + i] = ' ';
}
String FileUtils::NewProjectFileDialog()
{

    String projectPath;

    nfdchar_t *outPath = NULL;

    String upath;
    
#ifdef ATOMIC_PLATFORM_LINUX
    upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
#endif

    nfdresult_t result = NFD_PickFolder(upath.Length() ? GetNativePath(upath).CString() : "", &outPath);

    if (outPath && result == NFD_OKAY)
    {
        projectPath = outPath;
    }

    GetSubsystem<Graphics>()->RaiseWindow();

    if (outPath)
        free(outPath);

    return projectPath;

}
Example #12
0
//---------------------------------------------------------------------------
void __fastcall TFrmLogin::CarregaInfoUser()
{
	TZQuery *QyConsulta;
	String SenhaEmail;
	Variant Value;
try {
	QyConsulta = new TZQuery(Application);
	QyConsulta->Connection = AppConnection;
	QyConsulta->SQL->Add("SELECT nome, email, ies_administrador FROM tbl_usuario");
	QyConsulta->SQL->Add("WHERE usuario = '" + AppUser->Usuario + "';");
	QyConsulta->Open();
	AppParEmail->SMTPNomeExibicao = QyConsulta->FieldByName("nome")->AsString;
	AppParEmail->SMTPUsername = QyConsulta->FieldByName("email")->AsString;
	AppParEmail->SMTPConta = AppParEmail->SMTPUsername;
	Value = ValidacoesDB::GetParamValue(AppConnection,"CALL get_parametro_texto('epw_"+AppUser->Usuario+"');");
	SenhaEmail = VarToStr(Value);
	if (SenhaEmail.Length() > 0) {
		SenhaEmail = DecryptText(SenhaEmail.c_str());
		AppParEmail->SMTPPassword = SenhaEmail;
	} else {
		AppParEmail->SMTPPassword = "";
	}
   if (AppUser->Usuario == "administrador") {
      AppUser->IsAdm = true;
   } else {
      AppUser->IsAdm = (QyConsulta->FieldByName("ies_administrador")->AsString == "S");
   }
}
 __finally{delete(QyConsulta);}
}
void FileLoadRenderer::RenderAll(std::ostream &reply, Context &ctx, const ROAnything &config)
{
	StartTrace(FileLoadRenderer.RenderAll);

	String fileName;
	String quietRendered;
	bool quiet = false;
	RenderOnString(fileName, ctx, config["File2Load"]);
	RenderOnString(quietRendered, ctx, config["Quiet"]);
	quiet = (quietRendered == "yes") ? true : false;

	if (fileName.Length() == 0) {
		if ( !quiet ) {
			reply << "FileLoadRenderer: File2Load Param missing.";
		}
		return;
	}
	std::iostream *is = coast::system::OpenStream(fileName, String(), std::ios::in | std::ios::binary);
	if (!is ) {
		if ( !quiet ) {
			reply << "FileLoadRenderer: File " << fileName << " not found.";
		}
	} else {
		reply << is->rdbuf();
		delete(is);
	}
}
void JSResourceEditor::HandleWebMessage(StringHash eventType, VariantMap& eventData)
{
    using namespace WebMessage;

    const String& request = eventData[P_REQUEST].GetString();
    WebMessageHandler* handler = static_cast<WebMessageHandler*>(eventData[P_HANDLER].GetPtr());

    if (request == "change")
    {
        SetModified(true);
    }
    else
    {
        JSONValue jvalue;
        if (JSONFile::ParseJSON(request, jvalue, false))
        {
            String message = jvalue["message"].GetString();
            if (message == "saveCode")
            {
                String code = jvalue["payload"].GetString();
                File file(context_, fullpath_, FILE_WRITE);
                file.Write((void*) code.CString(), code.Length());
                file.Close();
            }
        }
    }

    handler->Success();

}
Example #15
0
Gdiplus::Status __fastcall TTiffImage::LoadFromFile(String filn) {
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
    WCHAR *LoadBitmapFiln;
    String mes;
    Gdiplus::Status s;

    if (fbm != NULL) delete fbm;

    Page = 0;
    LoadBitmapFiln = new WCHAR[filn.Length() + 1];
    AnsiToUnicode(filn.c_str(), -1, LoadBitmapFiln);

    fbm = new Gdiplus::Bitmap(LoadBitmapFiln);
    delete[] LoadBitmapFiln;
    s = fbm->GetLastStatus();
    if (s != Gdiplus::Ok) {
        delete fbm;
        fbm = NULL;
        return s;
    }
    Filn = filn;
    UINT count = 0;
    count = fbm->GetFrameDimensionsCount();
    GUID* pDimensionIDs = (GUID*)malloc(sizeof(GUID)*count);
    fbm->GetFrameDimensionsList(pDimensionIDs, count);
    DimensionID = pDimensionIDs[0];
    NPages = fbm->GetFrameCount(&DimensionID);
    free(pDimensionIDs);

    return Gdiplus::Ok;
}
String FileUtils::OpenProjectFileDialog()
{
    nfdchar_t *outPath = NULL;

    String upath;

#ifdef ATOMIC_PLATFORM_LINUX
    upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
#endif

    nfdresult_t result = NFD_OpenDialog( "atomic",
                                upath.Length() ? GetNativePath(upath).CString() : "",
                                &outPath);

    String fullpath;

    if (outPath && result == NFD_OKAY)
    {
        fullpath = outPath;
    }

    GetSubsystem<Graphics>()->RaiseWindow();

    if (outPath)
        free(outPath);

    return fullpath;

}
Example #17
0
//---------------------------------------------------------------------------
void __fastcall TSup1011::grdAddProdutoEditButtonClick(TObject *Sender)
{
	TPoint ptGrid;
	TRect rtCell;
	String sDate;

   if (!DsFornecProduto->AutoEdit)
      return;

	if (grdAddProduto->SelectedField->FieldName == "cod_produto") {
		SfgBrowse::EscolheProduto(this,&SearchProduto);
	} else if (grdAddProduto->SelectedField->FieldName == "data_atualizacao") {
		ptGrid.x = 0; ptGrid.y = 0;
		ptGrid = grdAddProduto->ClientToParent(ptGrid,this);
		THackCustomGrid *pHackGrid = (THackCustomGrid*)grdAddProduto;
		rtCell = pHackGrid->CellRect(pHackGrid->Col, pHackGrid->Row);
		rtCell.Left += ptGrid.x;
		rtCell.Top += ptGrid.y + 4;
		rtCell.Right += ptGrid.x;
		rtCell.Bottom += ptGrid.y + 4;
		sDate = ExecCalendarRect(rtCell,grdAddProduto->SelectedField->AsString);
		if(sDate.Length() > 0) {
         if (!(QyFornecProduto->State == dsEdit))
            QyFornecProduto->Edit();
         grdAddProduto->SelectedField->AsString = sDate;
		}
	}
}
Example #18
0
void ConsoleInput::HandleUpdate(StringHash eventType, VariantMap& eventData)
{
    // Check if there is input from stdin
    String input = GetConsoleInput();
    if (input.Length())
        HandleInput(input);
}
Example #19
0
TextureUnit ParseTextureUnitName(String name)
{
    name = name.ToLower().Trimmed();

    TextureUnit unit = (TextureUnit)GetStringListIndex(name.CString(), textureUnitNames, MAX_TEXTURE_UNITS);
    if (unit == MAX_TEXTURE_UNITS)
    {
        // Check also for shorthand names
        if (name == "diff")
            unit = TU_DIFFUSE;
        else if (name == "albedo")
            unit = TU_DIFFUSE;
        else if (name == "norm")
            unit = TU_NORMAL;
        else if (name == "spec")
            unit = TU_SPECULAR;
        else if (name == "env")
            unit = TU_ENVIRONMENT;
        // Finally check for specifying the texture unit directly as a number
        else if (name.Length() < 3)
            unit = (TextureUnit)Clamp(ToInt(name), 0, MAX_TEXTURE_UNITS - 1);
    }

    if (unit == MAX_TEXTURE_UNITS)
        LOGERROR("Unknown texture unit name " + name);

    return unit;
}
CurlRequest::CurlRequest(Context* context, const String& url, const String& postData) :
    Object(context)
{
    curl_ = curl_easy_init();

    // take care, curl doesn't make copies of all data
    url_ = url;
    postData_ = postData;

#if !(defined WIN32 || defined APPLE)
    // This line will eventually go away with a CA bundle in place, or other TLS options.
    curl_easy_setopt(curl_, CURLOPT_SSL_VERIFYPEER, 0L);
#endif

    curl_easy_setopt(curl_, CURLOPT_URL, url_.CString());
    curl_easy_setopt(curl_, CURLOPT_WRITEFUNCTION, Writer);

    if (postData.Length())
    {
        curl_easy_setopt(curl_, CURLOPT_POSTFIELDS, postData_.CString());
    }

    curl_easy_setopt(curl_, CURLOPT_WRITEDATA, (void *) this);

}
Example #21
0
void __fastcall TForm1::FileOpen1Accept(TObject *Sender)
{
String a = FileOpen1->Dialog->FileName;
if (a!=""){
// Öffnen
if (ExtractFileExt(a).UpperCase()!=".AD")a=a.SubString(1,a.Length()-ExtractFileExt(a).Length())+".ad";
TStringList *Liste = new TStringList();
Liste->LoadFromFile(a);

Max = StrToInt(Liste->Strings[0]);
Edit1->Text=Liste->Strings[1];
ListBox1->Clear();
Liste->Delete(0);
Liste->Delete(0);
for (int i=0;i<Max;i++){
ListBox1->Items->Add(Liste->Strings[i*67]);

for (int b=0;b<66;b++){
Data[i][b] = StrToInt(Liste->Strings[i*67 + b + 1]);
}
}
ListBox1->ItemIndex=0;
Selected = ListBox1->ItemIndex;
Load_Dat(Selected);
}
}
Example #22
0
//---------------------------------------------------------------------------
//
bool __fastcall TEditAlt::IsNumber(String Value, bool bFloat, bool bSign)
{
    int n = Value.Length();
    bool bSignExist = false;
    int iStart = 1;

    if (bSign && n > 0) {   // Знак + или - могут быть только вначале
        bSignExist = Value[1] == '+' || Value[1] == '-';
    }

    if (bSignExist) {   // Если был знак + или -, значит начинаем со второго символа
        iStart = 2;
    }

    bool nDotExist = false;
    for (int i = iStart; i <= n; i++)   // Цикл по символам
    {
        if (!isdigit(Value[i]) ) {
            if (bFloat && Value[i] == DecimalSeparator) {
                if (nDotExist)       // Если ранее уже была .
                    return false;
                else
                    nDotExist = true;
            } else {
                return false;
            }
        }
    }
    return true;
}
String PlatformAndroid::GetAndroidCommand() const
{
    ToolPrefs* prefs = GetSubsystem<ToolEnvironment>()->GetToolPrefs();

    String androidCommand = GetNativePath(prefs->GetAndroidSDKPath());

    if (!androidCommand.Length())
        return String::EMPTY;

#ifdef ATOMIC_PLATFORM_OSX
    //Vector<String> args = String("list targets").Split(' ');
    androidCommand += "/tools/android";
#endif
#ifdef ATOMIC_PLATFORM_WINDOWS

    // android is a batch file on windows, so have to run with cmd /c
    androidCommand += "\\tools\\android.bat";

    //androidCommand = "cmd";
#endif
#ifdef ATOMIC_PLATFORM_LINUX
    androidCommand += "/tools/android";
#endif
    return androidCommand;

}
Example #24
0
bool XMLFile::FromString(const String& source)
{
    if (source.Empty())
        return false;

    MemoryBuffer buffer(source.CString(), source.Length());
    return Load(buffer);
}
Example #25
0
Variant Material::ParseShaderParameterValue(const String& value)
{
    String valueTrimmed = value.Trimmed();
    if (valueTrimmed.Length() && IsAlpha(valueTrimmed[0]))
        return Variant(ToBool(valueTrimmed));
    else
        return ToVectorVariant(valueTrimmed);
}
Example #26
0
	void PropertyChangeAction::SetProperties(Vector<DataNode>& values)
	{
		Vector<SceneEditableObject*> objects = objectsIds.Select<SceneEditableObject*>([](SceneUID id) { 
			return o2Scene.GetEditableObjectByID(id); });

		const Type* componentType = nullptr;
		String finalPropertyPath = propertyPath;
		if (propertyPath.StartsWith("component:"))
		{
			int c = ((String)"component:").Length();

			String typeName = propertyPath.SubStr(c, propertyPath.Find('/', c));

			c += typeName.Length() + 1;
			finalPropertyPath.Erase(0, c);

			componentType = o2Reflection.GetType(typeName);
		}

		int i = 0;
		for (auto object : objects)
		{
			if (!object)
			{
				continue;
				i++;
			}

			FieldInfo* fi = nullptr;
			void* ptr = nullptr;

			if (componentType)
			{
				if (Actor* actor = dynamic_cast<Actor*>(object))
				{
					Component* component = actor->GetComponent(componentType);
					if (component)
						ptr = component->GetType().GetFieldPtr(component, finalPropertyPath, fi);
				}
			}
			else
			{
				auto objectType = dynamic_cast<const ObjectType*>(&object->GetType());
				if (objectType)
				{
					void* realTypeObject = objectType->DynamicCastFromIObject(dynamic_cast<IObject*>(object));
					ptr = objectType->GetFieldPtr(realTypeObject, finalPropertyPath, fi);
				}
			}

			if (fi && ptr)
				fi->Deserialize(ptr, values[i]);

			object->OnChanged();

			i++;
		}
	}
Example #27
0
void PixInsightX11Installer::CopyFiles( const String& targetDir, const String& sourceDir )
{
   if ( !targetDir.BeginsWith( '/' ) )
      throw Error( "CopyFiles(): Relative target directory." );
   if ( !sourceDir.BeginsWith( '/' ) )
      throw Error( "CopyFiles(): Relative source directory." );
   if ( targetDir.EndsWith( '/' ) || sourceDir.EndsWith( '/' ) )
      throw Error( "CopyFiles(): Incorrectly terminated directories." );
   if ( !File::DirectoryExists( targetDir ) )
      throw Error( "CopyFiles(): Nonexistent target directory." );
   if ( !File::DirectoryExists( sourceDir ) )
      throw Error( "CopyFiles(): Nonexistent source directory." );

   StringList sourceItems = SearchDirectory( sourceDir );

   size_type sourceDirLen = sourceDir.Length();
   for ( StringList::const_iterator i = sourceItems.Begin(); i != sourceItems.End(); ++i )
   {
      String relSourcePath = *i;
      relSourcePath.DeleteLeft( sourceDirLen );

      String targetPath = targetDir + relSourcePath;
      if ( targetPath.EndsWith( '/' ) )
      {
         /*
          * Create a subdirectory
          */
         targetPath.Delete( targetPath.UpperBound() );
         if ( !File::DirectoryExists( targetPath ) )
         {
            File::CreateDirectory( targetPath );
            String sourcePath = *i;
            sourcePath.Delete( sourcePath.UpperBound() );
            File::CopyTimesAndPermissions( targetPath, sourcePath );
         }
      }
      else
      {
         /*
          * Copy a file
          */
         /*
          * ### N.B. We don't have to create subdirectories here becase they
          * have been reported by SearchDirectory(), and we are creating them
          * before copying files. SearchDirectory() promises that all
          * subdirectories are reported before their contained files.
          */
         /*
         String targetSubdir = File::ExtractDirectory( targetPath );
         if ( targetSubdir.EndsWith( '/' ) )
            targetSubdir.Delete( targetSubdir.UpperBound() );
         if ( !File::DirectoryExists( targetSubdir ) )
            File::CreateDirectory( targetSubdir );
         */
         File::CopyFile( targetPath, *i );
      }
   }
}
Example #28
0
void Log::WriteRaw(const String& message, bool error)
{
    // If not in the main thread, store message for later processing
    if (!Thread::IsMainThread())
    {
        if (logInstance)
        {
            MutexLock lock(logInstance->logMutex_);
            logInstance->threadMessages_.Push(StoredLogMessage(message, LOG_RAW, error));
        }

        return;
    }

    // Prevent recursion during log event
    if (!logInstance || logInstance->inWrite_)
        return;

    logInstance->lastMessage_ = message;

#if defined(__ANDROID__)
    if (logInstance->quiet_)
    {
        if (error)
            __android_log_print(ANDROID_LOG_ERROR, "Urho3D", message.CString());
    }
    else
        __android_log_print(error ? ANDROID_LOG_ERROR : ANDROID_LOG_INFO, "Urho3D", message.CString());
#elif defined(IOS)
    SDL_IOS_LogMessage(message.CString());
#else
    if (logInstance->quiet_)
    {
        // If in quiet mode, still print the error message to the standard error stream
        if (error)
            PrintUnicode(message, true);
    }
    else
        PrintUnicode(message, error);
#endif

    if (logInstance->logFile_)
    {
        logInstance->logFile_->Write(message.CString(), message.Length());
        logInstance->logFile_->Flush();
    }

    logInstance->inWrite_ = true;

    using namespace LogMessage;

    VariantMap& eventData = logInstance->GetEventDataMap();
    eventData[P_MESSAGE] = message;
    eventData[P_LEVEL] = error ? LOG_ERROR : LOG_INFO;
    logInstance->SendEvent(E_LOGMESSAGE, eventData);

    logInstance->inWrite_ = false;
}
void DecimalFormatRenderer::InsertFiller(String  &sScale, String &strDecPlaces )
{
	StartTrace(DecimalFormatRenderer.InsertFiller);

	for ( long lIdx = strDecPlaces.Length(); lIdx < sScale.AsLong(0L) ; lIdx++) {
		strDecPlaces.Append("0");
		Trace("scale [ " << strDecPlaces << "] index [ " << lIdx << " ]");
	}
}
static unsigned NumberPostfix(const String& str)
{
    for (unsigned i = 0; i < str.Length(); ++i)
    {
        if (IsDigit(str[i]))
            return ToUInt(str.CString() + i);
    }

    return M_MAX_UNSIGNED;
}