Пример #1
0
 bool ResourceManager::CreateDirectoryPath(const String& DirectoryPath)
 {
     bool Result = true;
     StringVector FolderNames;
     CountedPtr<StringVector> FolderVec = StringTools::Split(DirectoryPath,"/\\");
     size_t StartIndex = 0;
     String PathAttempt;
     char SysSlash = GetDirectorySeparator();
     #ifdef WINDOWS
     // For windows and windows like machines, see if the first entry is a drive, because attempting to make a drive is silly.
     if(FolderVec->at(0).find(':') != String::npos)
     {
         PathAttempt.append( FolderVec->at(0) );
         PathAttempt.append( 1, SysSlash );
         StartIndex++;
     }
     #else
     PathAttempt.append( 1, SysSlash );
     #endif
     for( size_t VecIndex = StartIndex ; VecIndex < FolderVec->size() ; ++VecIndex )
     {
         PathAttempt.append( FolderVec->at(VecIndex) );
         PathAttempt.append( 1, SysSlash );
         Result = this->CreateDirectory( PathAttempt );
     }
     return Result;
 }
Пример #2
0
 ColourValue StringTools::ConvertToColourValue(const String& ToConvert)
 {
     CountedPtr<StringVector> Digits = Split(ToConvert);
     if(4 == Digits->size())
     {
         return ColourValue(ConvertToReal(Digits->at(0)),ConvertToReal(Digits->at(1)),ConvertToReal(Digits->at(2)),ConvertToReal(Digits->at(3)));
     }else{
         MEZZ_EXCEPTION(Exception::PARAMETERS_EXCEPTION,"String does not contain 4 digits when attempting to convert.");
     }
 }