コード例 #1
0
gstIconManager::gstIconManager(const std::string& path) {
  SetPath(IconReference::External, path);

  // Find all internal icons.
  if (khDirExists(kGESiteIconsPath))
    SetPath(IconReference::Internal, kGESiteIconsPath);
}
コード例 #2
0
ファイル: System.cpp プロジェクト: 4iDragon/rpcs3
bool Emulator::BootGame(const std::string& path, bool direct)
{
	static const char* boot_list[] =
	{
		"/PS3_GAME/USRDIR/BOOT.BIN",
		"/USRDIR/BOOT.BIN",
		"/BOOT.BIN",
		"/PS3_GAME/USRDIR/EBOOT.BIN",
		"/USRDIR/EBOOT.BIN",
		"/EBOOT.BIN",
	};

	if (direct && fs::is_file(path))
	{
		SetPath(path);
		Load();

		return true;
	}

	for (std::string elf : boot_list)
	{
		elf = path + elf;

		if (fs::is_file(elf))
		{
			SetPath(elf);
			Load();

			return true;
		}
	}

	return false;
}
コード例 #3
0
ファイル: Soldier.cpp プロジェクト: BlurEffect/SquadAI
//--------------------------------------------------------------------------------------
// Determines/Calculates a path to the current movement target and sets it as the active path.
// Param1: The time in seconds passed since the last frame.
// Returns the current state of the action.
//--------------------------------------------------------------------------------------
BehaviourStatus Soldier::DeterminePathToTarget(float deltaTime)
{
	if(GetCurrentOrder())
	{
		if(GetCurrentOrder()->GetOrderType() == MoveToPositionOrder && (GetCurrentOrder()->GetOrderPriority() == MediumPriority || GetCurrentOrder()->GetOrderPriority() == HighPriority) && !reinterpret_cast<MoveOrder*>(GetCurrentOrder())->GetPath()->empty())
		{
			// Use the path provided by the team AI
			SetPath(reinterpret_cast<MoveOrder*>(GetCurrentOrder())->GetPath());
			// If the path was started before, resume it.
			m_movementManager.SetCurrentNode(GetResumePathNode());
		}else
		{
			// Let the soldier find a path himself.
			SetPath(m_movementManager.CreatePathTo(GetMovementTarget()));
			m_movementManager.SetCurrentNode(0);
		}

		// If there is no path to the target of the order, notify the team AI that the current order cannot be completed.
		if(!GetPath())
		{
			UpdateOrderStateMessageData data(GetId(), FailedOrderState);
			SendMessage(GetTeamAI(), UpdateOrderStateMessageType, &data);
		}
	}else
	{
		// Let the soldier find a path himself.
		SetPath(m_movementManager.CreatePathTo(GetMovementTarget()));
		m_movementManager.SetCurrentNode(0);
	}
	
	return StatusSuccess;
}
コード例 #4
0
ファイル: file_lock.cpp プロジェクト: AlanDeSmet/htcondor
FileLock::FileLock( const char *path , bool deleteFile, bool useLiteralPath)
		: FileLockBase( )
{
	Reset( );

	ASSERT(path != NULL);
#ifndef WIN32
	if (deleteFile) {
		char *hPath = NULL;
		m_delete = 1;
		if (useLiteralPath) {
			SetPath(path);
		} else {
			hPath = CreateHashName(path);	
			SetPath(hPath);
			delete []hPath;
		}
		SetPath(path, true);
		m_init_succeeded = initLockFile(useLiteralPath);

	} else {
		SetPath(path);
	} 
	updateLockTimestamp();
#else
	SetPath(path);
	updateLockTimestamp();
#endif
}
コード例 #5
0
ファイル: pawspath.cpp プロジェクト: Chettie/Eulora-client
bool pawsPathWindow::OnButtonReleased(int /*mouseButton*/, int /*keyModifier*/, pawsWidget* widget)
{
    int id = widget->GetID();
    if (id <= PATH_0 + 6 && id > PATH_0)
    {
        SetPath(id - 1001);
        return true;
    }

    switch ( id )
    {   
        case BACK_BUTTON:
        {
            psengine->QuitClient();
            // added case to quit before upload
            return true;
        }
        case UPLOAD_BUTTON:
        {
            if (chosenPath == NO_CHOSEN_PATH)
            {
                psSystemMessage error(0,MSG_ERROR,
                                      PawsManager::GetSingleton().Translate("Please select a path"));
                error.FireEvent();
            }
            else
            {
                PawsManager::GetSingleton().CreateYesNoBox(
                    PawsManager::GetSingleton().Translate("Are you sure you want to save your character?"),
                    this );
            }
            return true;
        }
        case RANDOM_BUTTON:
        {
            int i = psengine->GetRandomGen().Get(6) + 1001;
            //pawsButton* button = (pawsButton*) FindWidget(i);
            SetPath(i - 1001);
            return true;
        }

        case QUIT_BUTTON:
        {
            psengine->QuitClient();
            // added case to quit before upload
            return true;
        }


        case CONFIRM_YES:
        {
            Hide();
            createManager->UploadChar();
        }
    }
    
    return false;
}
コード例 #6
0
BUrl::BUrl(const BUrl& base, const BString& location)
	:
	fUrlString(),
	fProtocol(),
	fUser(),
	fPassword(),
	fHost(),
	fPort(0),
	fPath(),
	fRequest(),
	fAuthorityValid(false),
	fUserInfoValid(false),
	fHasUserName(false),
	fHasPassword(false),
	fHasHost(false),
	fHasPort(false),
	fHasFragment(false)
{
	// This implements the algorithm in RFC3986, Section 5.2.

	BUrl relative(location);
	if (relative.HasProtocol()) {
		SetProtocol(relative.Protocol());
		if (relative.HasAuthority())
			SetAuthority(relative.Authority());
		SetPath(relative.Path());
		SetRequest(relative.Request());
	} else {
		if (relative.HasAuthority()) {
			SetAuthority(relative.Authority());
			SetPath(relative.Path());
			SetRequest(relative.Request());
		} else {
			if (relative.Path().IsEmpty()) {
				_SetPathUnsafe(base.Path());
				if (relative.HasRequest())
					SetRequest(relative.Request());
				else
					SetRequest(base.Request());
			} else {
				if (relative.Path()[0] == '/')
					SetPath(relative.Path());
				else {
					BString path = base._MergePath(relative.Path());
					SetPath(path);
				}
				SetRequest(relative.Request());
			}

			if (base.HasAuthority())
				SetAuthority(base.Authority());
		}
		SetProtocol(base.Protocol());
	}

	if (relative.HasFragment())
		SetFragment(relative.Fragment());
}
コード例 #7
0
ファイル: PathAndFile.cpp プロジェクト: AlphaPixel/3DNature
int PathAndFile::SearchDirectoryTree(char *RootDir)
{
char SearchStr[512];
WIN32_FIND_DATA FileData;
HANDLE Hand;

strmfp(SearchStr, RootDir, "*.*");
if ((Hand = FindFirstFile(SearchStr, &FileData)) != INVALID_HANDLE_VALUE)
	{
	if (FileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
		{
		if (FileData.cFileName[0] != '.')
			{
			strmfp(SearchStr, RootDir, FileData.cFileName);
			if (SearchDirectoryTree(SearchStr))
				{
				FindClose(Hand);
				return (1);
				} // if
			} // if
		} // if
	else if (! stricmp(GetName(), FileData.cFileName))
		{
		SetPath(GlobalApp->MainProj->UnMungPath(RootDir));
		FindClose(Hand);
		return (1);
		} // else

	while (FindNextFile(Hand, &FileData))
		{
		if (FileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
			{
			if (FileData.cFileName[0] != '.')
				{
				strmfp(SearchStr, RootDir, FileData.cFileName);
				if (SearchDirectoryTree(SearchStr))
					{
					FindClose(Hand);
					return (1);
					} // if
				} // if
			} // if
		else if (! stricmp(GetName(), FileData.cFileName))
			{
			SetPath(GlobalApp->MainProj->UnMungPath(RootDir));
			FindClose(Hand);
			return (1);
			} // else
		} // while
	FindClose(Hand);
	} // if

return (0);

} // PathAndFile::SearchDirectoryTree
コード例 #8
0
ファイル: file_lock.cpp プロジェクト: AlanDeSmet/htcondor
FileLock::FileLock( const char *path )
		: FileLockBase( )
{
	Reset( );

	ASSERT(path != NULL);

	SetPath(path);
	SetPath(path, true);
	updateLockTimestamp();
}
コード例 #9
0
ファイル: mmg.cpp プロジェクト: VRDate/mkvtoolnix
bool
mmg_app::OnInit() {
#ifdef __WXMAC__
  ProcessSerialNumber PSN;
  GetCurrentProcess(&PSN);
  TransformProcessType(&PSN, kProcessTransformToForegroundApplication);
#endif

  wxImage::AddHandler(new wxPNGHandler);

  mtx_common_init("mmg");

  debugging_c::send_to_logger(true);

  uint32_t i;
  wxString k, v;
  int index;

  prepare_mmg_data_folder();
  init_config_base();
  init_ui_locale();

  auto cfg = wxConfigBase::Get();
  cfg->SetPath(wxT("/GUI"));
  cfg->Read(wxT("last_directory"), &last_open_dir, wxEmptyString);
  for (i = 0; i < 4; i++) {
    k.Printf(wxT("last_settings %u"), i);
    if (cfg->Read(k, &v) && wxFile::Exists(v))
      last_settings.push_back(v);
    k.Printf(wxT("last_chapters %u"), i);
    if (cfg->Read(k, &v) && wxFile::Exists(v))
      last_chapters.push_back(v);
  }
  cfg->SetPath(wxT("/chapter_editor"));
  cfg->Read(wxT("default_language"), &k, wxT("und"));
  g_default_chapter_language = wxMB(k);
  index = map_to_iso639_2_code(g_default_chapter_language.c_str());
  if (-1 == index)
    g_default_chapter_language = "und";
  else
    g_default_chapter_language = iso639_languages[index].iso639_2_code;
  if (cfg->Read(wxT("default_country"), &k) && (0 < k.length()))
    g_default_chapter_country = wxMB(k);
  if (!is_valid_cctld(g_default_chapter_country.c_str()))
    g_default_chapter_country = "";

  app = this;
  mdlg = new mmg_dialog();
  mdlg->Show(true);

  handle_command_line_arguments();

  return true;
}
コード例 #10
0
ファイル: Url.cpp プロジェクト: naveedasmat/haiku
BUrl::BUrl(const BUrl& base, const BString& location)
	:
	fUrlString(),
	fProtocol(),
	fUser(),
	fPassword(),
	fHost(),
	fPort(0),
	fPath(),
	fRequest(),
	fHasAuthority(false)
{
	// This implements the algorithm in RFC3986, Section 5.2.

	BUrl relative(location);
	if (relative.HasProtocol()) {
		SetProtocol(relative.Protocol());
		SetAuthority(relative.Authority());
		SetPath(relative.Path()); // TODO _RemoveDotSegments()
		SetRequest(relative.Request());
	} else {
		if (relative.HasAuthority()) {
			SetAuthority(relative.Authority());
			SetPath(relative.Path()); // TODO _RemoveDotSegments()
			SetRequest(relative.Request());
		} else {
			if (relative.Path().IsEmpty()) {
				SetPath(base.Path());
				if (relative.HasRequest())
					SetRequest(relative.Request());
				else
					SetRequest(Request());
			} else {
				if (relative.Path()[0] == '/')
					SetPath(relative.Path());
				else {
					BString path = base.Path();
					// Remove last part of path (the file, if any) so we get the
					// "current directory"
					path.Truncate(path.FindLast('/') + 1);
					path += relative.Path();
					// TODO _RemoveDotSegments()
					SetPath(path);
				}
				SetRequest(relative.Request());
			}
			SetAuthority(base.Authority());
		}
		SetProtocol(base.Protocol());
	}

	SetFragment(relative.Fragment());
}
コード例 #11
0
ファイル: Emitter.cpp プロジェクト: k3a/Panther3D-1
void CP3DGUI_Emitter::Update()
{
	// tlacitka
	onOK = false;
	if (m_btnOK.OnPress())
	{
		// sestav cestu
		strcat(m_szPath, m_txtFilename.GetText());
		onOK = true;
	}
	if (m_btnCancel.OnPress())
		m_bHidden = true;

	// vybran adresar
	if (m_lstFolders.OnDblClick())
	{
		char* folder = m_lstFolders.GetItem(m_lstFolders.GetSelectedItem());
		if (!strcmp(folder, "..")) // o uroven nahoru
		{
			// odstran posledni slozku
			for(int i=strlen(m_szPath)-2;i>0;i--)
			{
				if (m_szPath[i]=='\\')
				{
					m_szPath[i] = 0;
					break;
				}
			}
			SetPath(m_szPath);
			return; // neni to obycejna slozka
		}

		if (!folder) return;
		// vybrana slozka
		strcat(m_szPath, folder); // uz ma lomitko, tak lze jen strcat
		SetPath(m_szPath);
	}

	// vybran soubor - jedno kliknuti
	if (m_lstFiles.OnSelect())
		m_txtFilename.SetText(m_lstFiles.GetItem(m_lstFiles.GetSelectedItem()));
	else if (m_lstFiles.OnDblClick())  // vybran soubor + zavri dialog
	{
		m_txtFilename.SetText(m_lstFiles.GetItem(m_lstFiles.GetSelectedItem()));
		// sestav cestu + zavrit dialog
		strcat(m_szPath, m_txtFilename.GetText());
		onOK = true;
	}

}
コード例 #12
0
ファイル: file_lock.cpp プロジェクト: AlanDeSmet/htcondor
void
FileLock::SetFdFpFile( int fd, FILE *fp, const char *file )
{
	// if I'm -1, NULL, NULL, that's ok, however, if file != NULL, then
	// either the fd or the fp must also be valid.
	if ((file == NULL && (fd >= 0 || fp != NULL)))
	{
		EXCEPT("FileLock::SetFdFpFile(). You must supply a valid file argument "
			"with a valid fd or fp_arg");
	}
#ifndef WIN32	
	if (m_delete == 1) {
		char *nPath = CreateHashName(file);	
		SetPath(nPath);	
		delete []nPath;
		close(m_fd);	
		m_fd = safe_open_wrapper_follow( m_path, O_RDWR | O_CREAT, 0644 );
		if (m_fd < 0) {
			dprintf(D_FULLDEBUG, "Lock File %s cannot be created.\n", m_path); 
			return;
		}
		updateLockTimestamp(); 
		return;
	}
#endif
	m_fd = fd;
	m_fp = fp;

	// Make sure we record our existence in the static list properly depending
	// on what the user is setting the variables to...
	if (m_path == NULL && file != NULL) {
		// moving from a NULL object to a object needed to update the timestamp

		SetPath(file);
		// This will use the new lock file in m_path
		updateLockTimestamp();

	} else if (m_path != NULL && file == NULL) {
		// moving from an updatable timestamped object to a NULL object

		SetPath(NULL);

	} else if (m_path != NULL && file != NULL) {
		// keeping the updatability of the object, but updating the path.
		
		SetPath(file);
		updateLockTimestamp();
	}
}
コード例 #13
0
wxReportImageItem::wxReportImageItem(const wxString& name, const wxString& path, double x, double y, int PPI, bool isVariable)
{
    this->m_sName = name;
    this->m_iType = wxRP_IMAGE;
    this->m_fVariable = isVariable;
    this->m_pVariable = NULL;

    if(x >= 0 && y >= 0)
        this->m_position = wxRealPoint(x, y);
    else
        this->m_position = wxRealPoint(0, 0);

    /*this->m_sValue = path;

    if(PPI > 0)
    	this->m_iPPI = PPI;

    wxInitAllImageHandlers();
    wxImage image(path);
    this->m_iHeight = image.GetHeight();
    this->m_iWidth = image.GetWidth();*/

    SetPath( path );
    SetPPI( PPI );
}
コード例 #14
0
ファイル: file_lock.cpp プロジェクト: AlanDeSmet/htcondor
bool
FileLock::initLockFile(bool useLiteralPath) 
{
	mode_t old_umask = umask(0);
	m_fd = rec_touch_file(m_path, 0666, 0777 ); 
	if (m_fd < 0) {
		if (!useLiteralPath) {
			dprintf(D_FULLDEBUG, "FileLock::FileLock: Unable to create file path %s. Trying with default /tmp path.\n", m_path);
			char *hPath = CreateHashName(m_orig_path, true);
			SetPath(hPath);
			delete []hPath;
			m_fd = rec_touch_file(m_path, 0666, 0777 ) ;
			if (m_fd < 0) { // /tmp does not work either ... 
				dprintf(D_ALWAYS, "FileLock::FileLock: File locks cannot be created on local disk - will fall back on locking the actual file. \n");
				umask(old_umask);
				m_delete = 0;
				return false;
			}
		} else {
			umask(old_umask);
			EXCEPT("FileLock::FileLock(): You must have a valid file path as argument.");
		}	
	}
	umask(old_umask);
	return true;
}
コード例 #15
0
FStringAssetReference::FStringAssetReference(const UObject* InObject)
{
	if (InObject)
	{
		SetPath(InObject->GetPathName());
	}
}
コード例 #16
0
void ODSPropPath :: SetPath (char *prop_path, ODSPropertyType prop_type )
{

  SetPath(prop_path,NULL,NO,NULL,prop_type);


}
コード例 #17
0
void FileDialog::SetFilename(const wxString& name)
{
   if (GetWindowStyle() & wxFD_SAVE)
      gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(name));
   else
      SetPath(wxFileName(GetDirectory(), name).GetFullPath());
}
コード例 #18
0
ファイル: Base.cpp プロジェクト: BoostedColliderAnalysis/BoCA
void Base::AddSignal(std::string const& file_name, latex::String const& latex_name, Crosssection const& crosssection, boca::Mass const& mass, std::string const& path)
{
    INFO0;
    auto file_info = boca::FileInfo{{file_name}, latex_name, crosssection, mass};
    file_info.SetPath(path);
    AddSignal(file_info);
}
コード例 #19
0
ファイル: PathAndFile.cpp プロジェクト: AlphaPixel/3DNature
const char *PathAndFile::AppendDirToPath(char *NewDir)
{
int OrigLen;

OrigLen = (int)strlen(Path);
if(OrigLen > 0)
	{
	if(!IsPathGlyph(Path[OrigLen - 1]))
		{
		// do we have room to append anything?
		if(OrigLen < WCS_PATHANDFILE_PATH_LEN_MINUSONE)
			{
			Path[OrigLen] = GetNativePathGlyph();
			OrigLen++; // Account for our '/' in current length
			// Put new NULL on end
			Path[OrigLen] = NULL;
			} // if
		} // if
	strncat(Path, NewDir, WCS_PATHANDFILE_PATH_LEN_MINUSONE - OrigLen);
	// ensure no unterminated strings
	Path[WCS_PATHANDFILE_PATH_LEN_MINUSONE] = 0;
	return(Path);
	} // if
else
	{
	return(SetPath(NewDir));
	} // else

} // PathAndFile::AppendDirToPath
コード例 #20
0
PRAGMA_POP

bool FStringAssetReference::Serialize(FArchive& Ar)
{
#if WITH_EDITOR
	if (Ar.IsSaving() && Ar.IsPersistent() && FCoreUObjectDelegates::StringAssetReferenceSaving.IsBound())
	{
		SetPath(FCoreUObjectDelegates::StringAssetReferenceSaving.Execute(ToString()));
	}
#endif // WITH_EDITOR
	Ar << *this;
#if WITH_EDITOR
	if (Ar.IsLoading() && Ar.IsPersistent() && FCoreUObjectDelegates::StringAssetReferenceLoaded.IsBound())
	{
		FCoreUObjectDelegates::StringAssetReferenceLoaded.Execute(ToString());
	}
#endif // WITH_EDITOR

	if (Ar.IsLoading() && (Ar.GetPortFlags()&PPF_DuplicateForPIE))
	{
		// Remap unique ID if necessary
		FixupForPIE();
	}

	return true;
}
コード例 #21
0
ファイル: dirpicker.cpp プロジェクト: RVictor/EmbeddedLite
void DirPicker::OnButtonClicked(wxCommandEvent &event)
{
    wxUnusedVar(event);

    //no default position was provided by the user
    //try to take it from the text control
    wxString work_dir = GetPath();
    m_defaultPos.Empty();
    if (work_dir.IsEmpty() == false) {
        if( wxDir::Exists(work_dir) ) {
            wxFileName fn(work_dir, wxEmptyString);
            wxLogMessage(work_dir + wxT(" exists"));
            fn.MakeAbsolute();
            m_defaultPos = fn.GetFullPath();
        }
    }

    if (m_defaultPos.IsEmpty()) {
        m_defaultPos = wxGetCwd();
    }

    wxLogMessage(wxT("setting working dir to : ") + m_defaultPos );

    wxDirDialog *dlg = new wxDirDialog(this, m_dlgCaption, m_defaultPos);
    if (dlg->ShowModal() == wxID_OK) {
        // Get the dirname
        wxString path = dlg->GetPath();
        SetPath(path);
    }
    dlg->Destroy();
}
コード例 #22
0
ファイル: filepicker.cpp プロジェクト: CobaltBlues/wxWidgets
bool wxDirButton::Create( wxWindow *parent, wxWindowID id,
                        const wxString &label, const wxString &path,
                        const wxString &message, const wxString &wildcard,
                        const wxPoint &pos, const wxSize &size,
                        long style, const wxValidator& validator,
                        const wxString &name )
{
    if (!(style & wxDIRP_USE_TEXTCTRL))
    {
        // VERY IMPORTANT: this code is identic to relative code in wxFileButton;
        //                 if you find a problem here, fix it also in wxFileButton !

        if (!PreCreation( parent, pos, size ) ||
            !wxControl::CreateBase(parent, id, pos, size, style & wxWINDOW_STYLE_MASK,
                                    validator, name))
        {
            wxFAIL_MSG( wxT("wxDirButtonGTK creation failed") );
            return false;
        }

        // create the dialog associated with this button
        SetWindowStyle(style);
        m_message = message;
        m_wildcard = wildcard;
        if ((m_dialog = CreateDialog()) == NULL)
            return false;
        SetPath(path);

        // little trick used to avoid problems when there are other GTK windows 'grabbed':
        // GtkFileChooserDialog won't be responsive to user events if there is another
        // window which called gtk_grab_add (and this happens if e.g. a wxDialog is running
        // in modal mode in the application - see wxDialogGTK::ShowModal).
        // An idea could be to put the grab on the m_dialog->m_widget when the GtkFileChooserButton
        // is clicked and then remove it as soon as the user closes the dialog itself.
        // Unfortunately there's no way to hook in the 'clicked' event of the GtkFileChooserButton,
        // thus we add grab on m_dialog->m_widget when it's shown and remove it when it's
        // hidden simply using its "show" and "hide" events - clean & simple :)
        g_signal_connect(m_dialog->m_widget, "show", G_CALLBACK(gtk_grab_add), NULL);
        g_signal_connect(m_dialog->m_widget, "hide", G_CALLBACK(gtk_grab_remove), NULL);


        // NOTE: we deliberately ignore the given label as GtkFileChooserButton
        //       use as label the currently selected file
        m_widget = gtk_file_chooser_button_new_with_dialog( m_dialog->m_widget );
        g_object_ref(m_widget);

        // GtkFileChooserButton signals
        g_signal_connect(m_widget, "current-folder-changed",
                         G_CALLBACK(gtk_dirbutton_currentfolderchanged_callback), this);

        m_parent->DoAddChild( this );

        PostCreation(size);
        SetInitialSize(size);
    }
    else
        return wxGenericDirButton::Create(parent, id, label, path, message, wildcard,
                                          pos, size, style, validator, name);
    return true;
}
コード例 #23
0
ファイル: iniconf.cpp プロジェクト: erwincoumans/wxWidgets
wxIniConfig::wxIniConfig(const wxString& strAppName,
                         const wxString& strVendor,
                         const wxString& localFilename,
                         const wxString& globalFilename,
                         long style)
           : wxConfigBase(!strAppName && wxTheApp ? wxTheApp->GetAppName()
                                               : strAppName,
                          !strVendor ? (wxTheApp ? wxTheApp->GetVendorName()
                                                  : strAppName)
                                      : strVendor,
                          localFilename, globalFilename, style)
{
    m_strLocalFilename = localFilename;
    if (m_strLocalFilename.empty())
    {
        m_strLocalFilename = GetAppName() + wxT(".ini");
    }

    // append the extension if none given and it's not an absolute file name
    // (otherwise we assume that they know what they're doing)
    if ( !wxIsPathSeparator(m_strLocalFilename[(size_t) 0]) &&
        m_strLocalFilename.Find('.') == wxNOT_FOUND )
    {
        m_strLocalFilename << wxT(".ini");
    }

    // set root path
    SetPath(wxEmptyString);
}
コード例 #24
0
ファイル: maingui.cpp プロジェクト: rustyx/encfs4win
extern "C" int main_gui(HINSTANCE /* hInstance */, HINSTANCE /* hPrevInstance */ , LPSTR /* lpCmdLine */ ,int nCmdShow)
{
	MSG msg;

	// set path in order to find encfs.exe
	SetPath();

	// check Dokan version
	if (!CheckDokan()) {
		MessageBox(NULL, _T("Dokan library not found or wrong version.\r\nencfs4win require Dokan 0.6.0 or later."), _T("EncFS"), MB_ICONERROR);
		EnableAutoStart(false);
		return 1;
	}

	// does not allow multiple instances
	if (CreateMutex(NULL, TRUE, _T("mtx78269e54-bfb5-44ed-a8fd-3e04058428e5")) == NULL)
		return 1;
	if (GetLastError() == ERROR_ALREADY_EXISTS)
		return 0;

	try {
		Drives::autoShow = Config::LoadGlobal("AutoShow") != 0;
	}
	catch (...) {}
	if (!InitInstance())
		return 1;

	while (GetMessage(&msg, NULL, 0, 0)) {
		if (!IsDialogMessage(msg.hwnd, &msg)) {
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}
	}
	return (int) msg.wParam;
}
コード例 #25
0
ファイル: FileManager.cpp プロジェクト: ADVALAIN596/PanelDue
	void FileSet::Reload(int whichList, const Path& dir)
	{
		SetIndex(whichList);
		SetPath(dir.c_str());
		RefreshPopup();
		StopTimer();
	}
コード例 #26
0
ファイル: Model.cpp プロジェクト: DT85/Assimilate
void CModel::DeriveName(LPCTSTR fromname)
{
	SetPath(fromname);
	if (fromname == NULL)
	{
		if (m_name != NULL)
		{
			free(m_name);
			m_name = NULL;
		}
		return;
	}
	CString name = fromname;
	int loc = name.ReverseFind('/');
	if (loc > -1)
	{
		name = name.Left(loc);
	}
	loc = name.ReverseFind('/');
	if (loc > -1)
	{
		name = name.Right(name.GetLength() - loc - 1);
	}
	SetName(name);
}
コード例 #27
0
ファイル: VolFile.cpp プロジェクト: ysangkok/pgp-win32-6.5.8
DualErr 
VolFile::Mount(
	LPCSTR		path, 
	PGPUInt8	drive, 
	PGPBoolean	mountReadOnly, 
	PAD_Mount	useThisPMNT)
{
	AD_Mount	MNT, *pMNT;
	DualErr		derr;

	pMNT = (useThisPMNT ? useThisPMNT : &MNT);

	pgpAssertAddrValid(pMNT, AD_Mount);
	pgpAssert(Unmounted());
	pgpAssert(!Opened());
	
	derr = SetPath(path);

	// Set the fields we are responsible for and call down.
	if (derr.IsntError())
	{
		pMNT->path		= path;
		pMNT->sizePath	= strlen(path) + 1;
		pMNT->drive		= drive;

		derr = Volume::Mount(mountReadOnly, pMNT);
	}

	if (derr.IsError())
	{
		ClearPath();
	}

	return derr;
}
コード例 #28
0
ファイル: MeshAsset.cpp プロジェクト: BenKZSSS/ToyGE
	String ShininessToRoughnessTex(const String & path)
	{
		auto roughnessTexPath = path.substr(0, path.rfind('.')) + "_roughness" + TextureAsset::GetExtension();
		if (Global::GetPlatform()->FileExists(roughnessTexPath))
			return roughnessTexPath;

		auto shininessTexAsset = Asset::Find<TextureAsset>(path);
		if (!shininessTexAsset->IsInit())
		{
			shininessTexAsset->Init();

			auto roughnessTexDesc = shininessTexAsset->GetTexture()->GetDesc();
			roughnessTexDesc.bindFlag = TEXTURE_BIND_SHADER_RESOURCE | TEXTURE_BIND_RENDER_TARGET | TEXTURE_BIND_GENERATE_MIPS;
			roughnessTexDesc.mipLevels = 0;
			auto roughnessTex = Global::GetRenderEngine()->GetRenderFactory()->CreateTexture(TEXTURE_2D);
			roughnessTex->SetDesc(roughnessTexDesc);
			roughnessTex->Init();

			auto ps = Shader::FindOrCreate<ShininessToRoughnessPS>();
			ps->SetSRV("shininessTex", shininessTexAsset->GetTexture()->GetShaderResourceView(0, 1, 0, 1));
			ps->SetSampler("pointSampler", SamplerTemplate<FILTER_MIN_MAG_MIP_POINT>::Get());
			ps->Flush();

			DrawQuad({ roughnessTex->GetRenderTargetView(0, 0, 1) });

			auto roughnessTexAsset = std::make_shared<TextureAsset>();
			roughnessTexAsset->SetPath(roughnessTexPath);
			roughnessTexAsset->Register();
			roughnessTexAsset->Save();
		}

		return roughnessTexPath;
	}
コード例 #29
0
ファイル: project.cpp プロジェクト: Aegisub/Aegisub
void Project::DoLoadAudio(agi::fs::path const& path, bool quiet) {
	if (!progress)
		progress = new DialogProgress(context->parent);

	try {
		try {
			audio_provider = GetAudioProvider(path, *context->path, progress);
		}
		catch (agi::UserCancelException const&) { return; }
		catch (...) {
			config::mru->Remove("Audio", path);
			throw;
		}
	}
	catch (agi::fs::FileNotFound const& e) {
		return ShowError(_("The audio file was not found: ") + to_wx(e.GetMessage()));
	}
	catch (agi::AudioDataNotFound const& e) {
		if (quiet) {
			LOG_D("video/open/audio") << "File " << video_file << " has no audio data: " << e.GetMessage();
			return;
		}
		else
			return ShowError(_("None of the available audio providers recognised the selected file as containing audio data.\n\nThe following providers were tried:\n") + to_wx(e.GetMessage()));
	}
	catch (agi::AudioProviderError const& e) {
		return ShowError(_("None of the available audio providers have a codec available to handle the selected file.\n\nThe following providers were tried:\n") + to_wx(e.GetMessage()));
	}
	catch (agi::Exception const& e) {
		return ShowError(e.GetMessage());
	}

	SetPath(audio_file, "?audio", "Audio", path);
	AnnounceAudioProviderModified(audio_provider.get());
}
コード例 #30
0
void FStringAssetReference::FixupForPIE()
{
	if (FPlatformProperties::HasEditorOnlyData() && IsValid())
	{
		FString Path = ToString();

		// Determine if this reference has already been fixed up for PIE
		const FString ShortPackageOuterAndName = FPackageName::GetLongPackageAssetName(Path);
		if (!ShortPackageOuterAndName.StartsWith(PLAYWORLD_PACKAGE_PREFIX))
		{
			check(GPlayInEditorID != -1);

			FString PIEPath = FString::Printf(TEXT("%s/%s_%d_%s"), *FPackageName::GetLongPackagePath(Path), PLAYWORLD_PACKAGE_PREFIX, GPlayInEditorID, *ShortPackageOuterAndName);

			// Determine if this refers to a package that is being duplicated for PIE
			for (auto PackageNameIt = PackageNamesBeingDuplicatedForPIE.CreateConstIterator(); PackageNameIt; ++PackageNameIt)
			{
				const FString PathPrefix = (*PackageNameIt) + TEXT(".");
				if (PIEPath.StartsWith(PathPrefix))
				{
					// Need to prepend PIE prefix, as we're in PIE and this refers to an object in a PIE package
					SetPath(MoveTemp(PIEPath));

					break;
				}
			}
		}
	}
}