VFolder* VRIAServerSolution::RetainFolder() const
{
	VFolder *folder = NULL;

	if (fDesignSolution != NULL)
	{
		VProjectItem *item = fDesignSolution->GetSolutionFileProjectItem();
		if (item != NULL)
		{
			VFilePath path;
			item->GetFilePath( path);
			path = path.ToFolder();
			if (path.IsFolder())
			{
				folder = new VFolder( path);
				if (folder != NULL && !folder->Exists())
				{
					folder->Release();
					folder = NULL;
				}
			}
		}
	}	
	return folder;
}
Ejemplo n.º 2
0
VFolder* XWinLibrary::RetainFolder(const VFilePath &inPath, BundleFolderKind inKind) const
{
	VFolder *folder = NULL;
	if (inPath.IsFile())
	{
		switch( inKind)
		{
			case kBF_BUNDLE_FOLDER:					// The folder hosting the bundle
			case kBF_EXECUTABLE_FOLDER:				// The folder of executable file (platform related)
				{
					VFilePath parent = inPath;
					folder = new VFolder( parent.ToParent());
				}

			default:
				assert( false);
				break;
		}
	}
	else if (inPath.IsFolder())
	{
		switch( inKind)
		{
			case kBF_BUNDLE_FOLDER:					// The folder hosting the bundle
				{
					VFilePath parent = inPath;
					folder = new VFolder( parent/*.ToParent()*/);
					break;
				}

			case kBF_EXECUTABLE_FOLDER:				// The folder of executable file (platform related)
				{
					VFilePath executablePath;
					if (_BuildExecutablePath( inPath, executablePath))
					{
						folder = new VFolder( executablePath.ToFolder());
					}
					break;
				}

			case kBF_RESOURCES_FOLDER:				// The folder of main resources
				{
					VFilePath path = inPath;
					path.ToSubFolder( CVSTR("Contents")).ToSubFolder( CVSTR( "Resources"));
					folder = new VFolder( path);
					break;
				}

			case kBF_LOCALISED_RESOURCES_FOLDER:	// The folder of prefered localization
			case kBF_PLUGINS_FOLDER:				// The folder for bundle's plugins
			case kBF_PRIVATE_FRAMEWORKS_FOLDER:		// The folder for private frameworks
			case kBF_PRIVATE_SUPPORT_FOLDER:		// The folder for private support files
			default:
				assert( false);
				break;
		}
	}
	return folder;
}
VFolder* VRIAServerSolution::RetainLogFolder( bool inCreateIfNotExists) const
{
	VFolder *folder = NULL;

	if (fDesignSolution != NULL)
	{
		VProjectItem *item = fDesignSolution->GetSolutionFileProjectItem();
		if (item != NULL)
		{
			VFilePath path;
			item->GetFilePath( path);
			path = path.ToFolder();
			path.ToSubFolder( L"Logs");
			folder = new VFolder( path);
			if (folder != NULL && !folder->Exists() && inCreateIfNotExists)
				folder->Create();
		}
	}
	return folder;
}