• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CheckFile函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中CheckFile函数的典型用法代码示例。如果您正苦于以下问题:C++ CheckFile函数的具体用法?C++ CheckFile怎么用?C++ CheckFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了CheckFile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: CrossPlatformFilterCallback

pascal Boolean CrossPlatformFilterCallback (
    AEDesc *theItem,
    void *info,
    void *callBackUD,
    NavFilterModes filterMode
)
{
    bool display = true;
    OpenUserDataRecPtr data = (OpenUserDataRecPtr) callBackUD ;

    if (filterMode == kNavFilteringBrowserList)
    {
        NavFileOrFolderInfo* theInfo = (NavFileOrFolderInfo*) info ;
        if ( !theInfo->isFolder )
        {
            if (theItem->descriptorType == typeFSS )
            {
                FSSpec    spec;
                memcpy( &spec , *theItem->dataHandle , sizeof(FSSpec) ) ;
                wxString file = wxMacMakeStringFromPascal( spec.name ) ;
                display = CheckFile( file , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ;
            }
            else if ( theItem->descriptorType == typeFSRef )
            {
                FSRef fsref ;
                memcpy( &fsref , *theItem->dataHandle , sizeof(FSRef) ) ;
                wxString file = wxMacFSRefToPath( &fsref ) ;
                display = CheckFile( file , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ;
            }
        }
    }

    return display;
}
开发者ID:Duion,项目名称:Torsion,代码行数:34,代码来源:filedlg.cpp


示例2: snprintf

bool CSettings::FindConfig()
{
	bool found = false;
	char CheckDevice[12];
	char CheckPath[300];

	// Enumerate the devices supported by libogc.
	for (int i = SD; (i < MAXDEVICES) && !found; ++i)
	{
		snprintf(CheckDevice, sizeof(CheckDevice), "%s:", DeviceName[i]);

		if(!found)
		{
			// Check for the config file in the apps directory.
			strlcpy(BootDevice, CheckDevice, sizeof(BootDevice));
			snprintf(ConfigPath, sizeof(ConfigPath), "%s/apps/usbloader_gx/", BootDevice);
			snprintf(CheckPath, sizeof(CheckPath), "%sGXGlobal.cfg", ConfigPath);
			found = CheckFile(CheckPath);
		}
		if(!found)
		{
			// Check for the config file in the config directory.
			strlcpy(BootDevice, CheckDevice, sizeof(BootDevice));
			snprintf(ConfigPath, sizeof(ConfigPath), "%s/config/", BootDevice);
			snprintf(CheckPath, sizeof(CheckPath), "%sGXGlobal.cfg", ConfigPath);
			found = CheckFile(CheckPath);
		}
	}

	FILE * testFp = NULL;
	//! No existing config so try to find a place where we can write it too
	for (int i = SD; (i < MAXDEVICES) && !found; ++i)
	{
		sprintf(CheckDevice, "%s:", DeviceName[i]);

		if (!found)
		{
			// Check if we can write to the apps directory.
			strlcpy(BootDevice, CheckDevice, sizeof(BootDevice));
			snprintf(ConfigPath, sizeof(ConfigPath), "%s/apps/usbloader_gx/", BootDevice);
			snprintf(CheckPath, sizeof(CheckPath), "%sGXGlobal.cfg", ConfigPath);
			testFp = fopen(CheckPath, "wb");
			found = (testFp != NULL);
			if(testFp) fclose(testFp);
		}
		if (!found)
		{
			// Check if we can write to the config directory.
			strlcpy(BootDevice, CheckDevice, sizeof(BootDevice));
			snprintf(ConfigPath, sizeof(ConfigPath), "%s/config/", BootDevice);
			CreateSubfolder(ConfigPath);
			snprintf(CheckPath, sizeof(CheckPath), "%sGXGlobal.cfg", ConfigPath);
			testFp = fopen(CheckPath, "wb");
			found = (testFp != NULL);
			if(testFp) fclose(testFp);
		}
	}

	return found;
}
开发者ID:SuperrSonic,项目名称:ULGX-ICON-VIEW,代码行数:60,代码来源:CSettings.cpp


示例3: Exit

bool SjKaraokeMaster::Init(const wxString& musicFile, const wxString& artist, const wxString& title)
{
	wxFSFile* fsFile;

	// exit old stuff
	Exit();

	if( musicFile.StartsWith(wxT("http:")) // this may be a steam - in this case (or in others) we get into an endless loop
	 || musicFile.StartsWith(wxT("https:"))
	 || musicFile.StartsWith(wxT("ftp:")) )
		return false;

	// try to create CDG (try musicFile.cdg and musicFile.mp3.cdg)
	if( (fsFile=CheckFile(musicFile, wxT("cdg"))) )
	{
		m_reader = new SjCdgReader(fsFile); // SjCdgReader takes ownership of fsFile!
		return true; // success
	}

	// try to create LRC (Simple Lyrics)
	if( (fsFile=CheckFile(musicFile, wxT("lrc"))) )
	{
		m_reader = new SjSyncTxtReader(fsFile, SJ_SYNCTXT_LRC, artist, title); // SjSyncTxtReader takes ownership of fsFile!
		return true; // success
	}

	// no karaoke file available
	return false;
}
开发者ID:boh1996,项目名称:silverjuke,代码行数:29,代码来源:vis_karaoke_module.cpp


示例4: CheckRecursivFiles

//----------------------------------------------------------------
void CheckRecursivFiles(DWORD iitem, char *remote_name, char *file, BOOL recursif)
{
  //if the file exist
  WIN32_FIND_DATA data, d0;
  HANDLE hfind;
  char tmp_path[LINE_SIZE]="",tmp_remote_name[LINE_SIZE];

  if (file != NULL)
  {
    snprintf(tmp_path,LINE_SIZE,"%s\\%s",remote_name,file);
    if (GetFileAttributes(tmp_path) != INVALID_FILE_ATTRIBUTES && scan_start)
    {
      //file exist + date
      hfind = FindFirstFile(tmp_path, &d0);
      if (hfind != INVALID_HANDLE_VALUE)
      {
        CheckFile(iitem, tmp_path, &d0, file);
        FindClose(hfind);
      }
    }

    if (tmp_path[strlen(tmp_path)-1] == '\\' || tmp_path[strlen(tmp_path)-1] == '/')
    {
      //if directory !
      tmp_path[strlen(tmp_path)-1] = 0; // remove the ending /
      CheckRecursivFiles(iitem, tmp_path, NULL, recursif);
    }
  }

  //next
  snprintf(tmp_path,LINE_SIZE,"%s\\*.*",remote_name);
  hfind = FindFirstFile(tmp_path, &data);
  if (hfind != INVALID_HANDLE_VALUE && scan_start)
  {
    do
    {
      if (data.cFileName[0] == '.' && (data.cFileName[1] == 0 || (data.cFileName[2] == 0 && data.cFileName[1] == '.'))){}
      else
      {
        if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
        {
          if (recursif)
          {
            snprintf(tmp_remote_name,LINE_SIZE,"%s\\%s",remote_name,data.cFileName);
            CheckRecursivFiles(iitem, tmp_remote_name, file, recursif);
          }
        }else
        {
          if (file == NULL)
          {
            snprintf(tmp_remote_name,LINE_SIZE,"%s\\%s",remote_name,data.cFileName);
            CheckFile(iitem, tmp_remote_name, &data, "CURRENT DIRECORY CONTENT");
          }
        }
      }
    }while(FindNextFile(hfind, &data) != 0 && scan_start);
    FindClose(hfind);
  }
}
开发者ID:garfieldchien,项目名称:omnia-projetcs,代码行数:60,代码来源:Files.c


示例5: atoi

void CUCPDetail::OnUcpdApply()
{
CString	tempstr;

	m_ucpd_broker.GetWindowText(m_ucinfo->m_broker);
	if (m_ucpd_service.GetCheck() == 0) {
		m_ucinfo->m_service = false;
	} else {
		m_ucinfo->m_service = true;
	}
	m_ucinfo->m_appl_server = m_ucpd_appl_server.GetCurSel();
	m_ucpd_broker_port.GetWindowText(m_ucinfo->m_broker_port);
	m_ucpd_appl_server_shm_id.GetWindowText(m_ucinfo->m_appl_server_shm_id);
	if (m_ucpd_auto_add_appl_server.GetCheck() == 0) {
		m_ucinfo->m_auto_add_appl_server = false;
	} else {
		m_ucinfo->m_auto_add_appl_server = true;
	}
	m_ucpd_min_num_appl_server.GetWindowText(tempstr);
	m_ucinfo->m_min_num_appl_server = atoi(LPCSTR(tempstr));
	m_ucpd_max_num_appl_server.GetWindowText(tempstr);
	m_ucinfo->m_max_num_appl_server = atoi(LPCSTR(tempstr));
	m_ucpd_appl_server_max_size.GetWindowText(tempstr);
	m_ucinfo->m_appl_server_max_size = atoi(LPCSTR(tempstr));

	CheckFile(m_ucpd_log_dir, false);
	m_ucpd_log_dir.GetWindowText(m_ucinfo->m_log_dir);
	if (m_ucpd_log_backup.GetCheck() == 0) {
		m_ucinfo->m_log_backup = false;
	} else {
		m_ucinfo->m_log_backup = true;
	}
	if (m_ucpd_sql_log.GetCheck() == 0) {
		m_ucinfo->m_sql_log = false;
	} else {
		m_ucinfo->m_sql_log = true;
	}
	if (m_ucpd_access_log.GetCheck() == 0) {
		m_ucinfo->m_access_log = false;
	} else {
		m_ucinfo->m_access_log = true;
	}

	if (m_ucpd_security.GetCheck() == 0) {
		m_ucinfo->m_security = false;
	} else {
		m_ucinfo->m_security = true;
	}
	CheckFile(m_ucpd_access_list);
	m_ucpd_access_list.GetWindowText(m_ucinfo->m_access_list);

	CheckFile(m_ucpd_source_env);
	m_ucpd_source_env.GetWindowText(m_ucinfo->m_source_env);
	m_ucpd_time_to_kill.GetWindowText(m_ucinfo->m_time_to_kill);
	m_ucpd_session_timeout.GetWindowText(m_ucinfo->m_session_timeout);
	m_ucpd_job_queue_size.GetWindowText(m_ucinfo->m_job_queue_size);

	CDialog::OnOK();
}
开发者ID:CUBRID,项目名称:cubrid,代码行数:59,代码来源:UCPDETAIL.CPP


示例6: OllyPython_Init

BOOL OllyPython_Init(void)
{
    char initfile[MAX_PATH];
    char tmp[MAX_PATH+16];
    BOOL result = 1;

    if (initialized == 1)
    {
        return TRUE;
    }

    Addtolist(0, 0, "OllyPython");

    result &= CheckFile("init.py");
    result &= CheckFile("ollyapi.py");
    result &= CheckFile("ollyutils.py");

    if (!result)
    {
        Addtolist(0, -1, "  Could not locate Python scripts");
        return FALSE;
    }

    Py_Initialize();

    if (!Py_IsInitialized())
    {
        Addtolist(0, -1, "  Could not initialize Python");
        return FALSE;
    }

    init_ollyapi();

    GetModuleFileName(hinst, initfile, MAX_PATH);
    PathRemoveFileSpec(initfile);
    strncat(initfile, "\\python", 7);

    snprintf(tmp, MAX_PATH+16, "OLLYPYTHON_PATH=\"%s\"", initfile);
    PyRun_SimpleString(tmp);

    strncat(initfile, "\\init.py", 8);

    if (!ExecFile(initfile))
    {
        Addtolist(0, -1, "  Could not run init.py");
        return FALSE;
    }

#ifdef ENABLE_PYTHON_PROFILING
    PyEval_SetTrace(tracefunc, NULL);
#endif

    initialized = 1;

    return TRUE;
}
开发者ID:ur4ltz,项目名称:ollypython,代码行数:56,代码来源:ollypython.c


示例7: CheckFile

int CDataBase::CheckDB()
{
	int res = CheckFile(DBFileSetting);

	if (res != EGROKPRF_NOERROR)
		return res;

	if (PrivateFileExists())
		res = CheckFile(DBFilePrivate);

	return res;
}
开发者ID:BackupTheBerlios,项目名称:mgoodies-svn,代码行数:12,代码来源:DataBase.cpp


示例8: check_file

static char  *
check_file (const char *file)
{
	char         *full_file;

	full_file = mystrdup (file);

	if (CheckFile (full_file) == 0)
		return full_file;
	replace_envvar (&full_file);
	if (CheckFile (full_file) == 0)
		return full_file;
	free (full_file);
	return NULL;
}
开发者ID:Vaevictusnet,项目名称:afterstep-devel,代码行数:15,代码来源:session.c


示例9: TEST_FIXTURE

	// ChecksumSHA1: Get(File &cFile)
	TEST_FIXTURE(ConstructTest, ChecksumSHA1__Get_File__cFile_) {
		// Check 'demotest.xml'
		sChecksum = CheckFile(sumSHA1, "../Data/unitTestData/ChecksumTest_demo.xml");
		CHECK_EQUAL("3225f273bb21d4252ac978da0d71fadb1e78eb7f", sChecksum.GetASCII());

		// Check 'tokenizer.txt'
		sChecksum = CheckFile(sumSHA1, "../Data/unitTestData/ChecksumTest_tokenizer.txt");
		// [TODO] fails!
		CHECK_EQUAL("b6f311adc109cfe58ec1156ad926260c725f3945", sChecksum.GetASCII());

		// Check 'test.zip'
		sChecksum = CheckFile(sumSHA1, "../Data/unitTestData/ChecksumTest_test.zip");
		// [TODO] fails!
		CHECK_EQUAL("1e531304afa05d60b5f9d1cd11b81cdbfae90947", sChecksum.GetASCII());
	}
开发者ID:ByeDream,项目名称:pixellight,代码行数:16,代码来源:ChecksumSHA1.cpp


示例10: TEST_FIXTURE

	// ChecksumMD5: Get(File &cFile)
	TEST_FIXTURE(ConstructTest, ChecksumMD5__Get_File__cFile_) {
		// Check 'demotest.xml'
		sChecksum = CheckFile(sumMD5, "../Data/unitTestData/ChecksumTest_demo.xml");
		CHECK_EQUAL("313a0294c72a84409c9dd6267d44730f", sChecksum.GetASCII());

		// Check 'tokenizer.txt'
		sChecksum = CheckFile(sumMD5, "../Data/unitTestData/ChecksumTest_tokenizer.txt");
		// [TODO] fails!
		CHECK_EQUAL("3ef605c74b399d7d869afb40de4cede4", sChecksum.GetASCII());

		// Check 'test.zip'
		sChecksum = CheckFile(sumMD5, "../Data/unitTestData/ChecksumTest_test.zip");
		// [TODO] fails!
		CHECK_EQUAL("898d399c87c96a6f73814b1940fbca16", sChecksum.GetASCII());
	}
开发者ID:ByeDream,项目名称:pixellight,代码行数:16,代码来源:ChecksumMD5.cpp


示例11: FilesTest

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int FilesTest()
{
    std::cout  << "|- FilesTest -----------------" << std::endl;
    int err = 0;
    bool ok;

    std::string testdir = MXAUnitTest::MXATempDir + MXAUnitTest::MXAFileSystemPathTest::TestDir;


    CheckFile(MXAUnitTest::MXAFileSystemPathTest::OutputFile,
              MXAUnitTest::MXAFileSystemPathTest::OutputFileName,
              MXAUnitTest::MXAFileSystemPathTest::Extension);

    std::string testFileName = ".hidden_file";
    std::string testFilePath = testdir + MXAUnitTest::DirSeparator + testFileName;
    std::string ext; // No Extension
    CheckFile(testFilePath, testFileName, ext);

    testFileName = "Normal.txt";
    ok = MXADir::mkdir(testdir + MXAUnitTest::DirSeparator + "Dot.Dir" + MXAUnitTest::DirSeparator, true);
    DREAM3D_REQUIRE_EQUAL(ok, true);
    testFilePath = testdir + MXAUnitTest::DirSeparator + "Dot.Dir" + MXAUnitTest::DirSeparator + testFileName;
    ext = "txt";
    CheckFile(testFilePath, testFileName, ext);
    ok = MXADir::rmdir(testdir + MXAUnitTest::DirSeparator + "Dot.Dir" + MXAUnitTest::DirSeparator, false);
    DREAM3D_REQUIRE_EQUAL(ok, true);

    testFileName = "No_Extension";
    ok = MXADir::mkdir(testdir + MXAUnitTest::DirSeparator + "Dot.Dir" + MXAUnitTest::DirSeparator, true);
    DREAM3D_REQUIRE_EQUAL(ok, true);
    testFilePath = testdir + MXAUnitTest::DirSeparator + "Dot.Dir" + MXAUnitTest::DirSeparator + testFileName;
    ext = "";
    CheckFile(testFilePath, testFileName, ext);
    ok = MXADir::rmdir(testdir + MXAUnitTest::DirSeparator + "Dot.Dir" + MXAUnitTest::DirSeparator, false);
    DREAM3D_REQUIRE_EQUAL(ok, true);

    testFileName = "EndsWithDot.";
    ok = MXADir::mkdir(testdir + MXAUnitTest::DirSeparator + "Dot.Dir" + MXAUnitTest::DirSeparator, true);
    DREAM3D_REQUIRE_EQUAL(ok, true);
    testFilePath = testdir + MXAUnitTest::DirSeparator + "Dot.Dir" + MXAUnitTest::DirSeparator + testFileName;
    ext = "";
    CheckFile(testFilePath, testFileName, ext);
    ok = MXADir::rmdir(testdir + MXAUnitTest::DirSeparator + "Dot.Dir" + MXAUnitTest::DirSeparator, false);
    DREAM3D_REQUIRE_EQUAL(ok, true);


    return err;
}
开发者ID:leavy,项目名称:DREAM3D,代码行数:51,代码来源:MXAFileSystemPathTest.cpp


示例12: CreateDirectory

bool FileSystem::CreateDirectory(std::string dir) const
{
	if (!CheckFile(dir))
		return false;
	FixSlashes(dir);
	return fs.mkdir(dir);
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:7,代码来源:FileSystem.cpp


示例13: GetFilesize

size_t FileSystem::GetFilesize(std::string file) const
{
	if (!CheckFile(file))
		return 0;
	FixSlashes(file);
	return fs.GetFilesize(file);
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:7,代码来源:FileSystem.cpp


示例14: ofstream

std::ofstream* FileSystem::ofstream(std::string file, std::ios_base::openmode mode) const
{
	if (!CheckFile(file))
		return NULL;
	FixSlashes(file);
	return fs.ofstream(file, mode);
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:7,代码来源:FileSystem.cpp


示例15: fopen

FILE* FileSystem::fopen(std::string file, const char* mode) const
{
	if (!CheckFile(file) || !CheckMode(mode))
		return NULL;
	FixSlashes(file);
	return fs.fopen(file, mode);
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:7,代码来源:FileSystem.cpp


示例16: FindFilename

// Find the filename
void FindFilename(u64 offset)
{
	// Don't do anything if a game is not running
	if (Core::GetState() != Core::CORE_RUN)
		return;

	// Or if the log is unselected
	if (!LogManager::GetInstance()->IsEnabled(LogTypes::FILEMON, LogTypes::LWARNING))
		return;

	// Or if we don't have file access
	if (!FileAccess)
		return;

	if (!s_filesystem || ISOFile != SConfig::GetInstance().m_LastFilename)
	{
		FileAccess = false;
		ReadFileSystem(SConfig::GetInstance().m_LastFilename);
		ISOFile = SConfig::GetInstance().m_LastFilename;
		INFO_LOG(FILEMON, "Opening '%s'", ISOFile.c_str());
		return;
	}

	const std::string filename = s_filesystem->GetFileName(offset);

	if (filename.empty())
		return;

	CheckFile(filename, s_filesystem->GetFileSize(filename));
}
开发者ID:Abrahamh08,项目名称:dolphin,代码行数:31,代码来源:FileMonitor.cpp


示例17: on_list_del_clicked

void
on_list_del_clicked(GtkButton *button, gpointer user_data)
{
	ASGtkImageDir *id = ASGTK_IMAGE_DIR(user_data);
	ASImageListEntry *entry = asgtk_image_dir_get_selection( id );
	if( entry ) 
	{	
		if( asgtk_yes_no_question1( WallpaperState.main_window, "Do you really want to delete private background file \"%s\" ???", entry->name ) )
		{
			if( id->mini_extension ) 
			{	
				char *mini_filename, *mini_fullfilename ;
				asgtk_image_dir_make_mini_names( id, entry->name, &mini_filename, &mini_fullfilename ); 
				
				if( CheckFile( mini_fullfilename ) == 0 ) 
				{
					if( asgtk_yes_no_question1( WallpaperState.main_window, "It appears that there is a minipixmap for deleted background with the name \"%s\". Would you like to delete it as well ?", mini_filename ) )
					{
						unlink( mini_fullfilename );
					}	 				   
				}	
				free( mini_fullfilename );
				free( mini_filename );
			}			
			unlink( entry->fullfilename );
			asgtk_info2( WallpaperState.main_window, "Background image \"%s\" deleted.", entry->name, NULL );	  
			asgtk_image_dir_refresh( id );	 
		}	 
		unref_asimage_list_entry( entry );
	}
}
开发者ID:cooljeanius,项目名称:AfterStep,代码行数:31,代码来源:interface.c


示例18: SearchDirectory

// search in directory for the NDS file
bool SearchDirectory() {
    DIR_ITER *dir;
    bool found = false;
    char path[EFS_MAXPATHLEN];
    char filename[EFS_MAXPATHLEN];
    struct stat st; 
 
    dir = diropen(".");
    while((dirnext(dir, filename, &st) == 0) && (!found)) {
        if(st.st_mode & S_IFDIR) {
            if(((strlen(filename) == 1) && (filename[0]!= '.')) ||
                ((strlen(filename) == 2) && (strcasecmp(filename, "..")))  ||
                (strlen(filename) > 2))
            {
                chdir(filename);
                found = SearchDirectory();
                chdir("..");
            }
        } else {
            getcwd(path, EFS_MAXPATHLEN-1);
            strcat(path, filename);
        
            if(CheckFile(path, true)) {
                found = true;
                break;
            }
        }
    }
    dirclose(dir);
    
    return found;
} 
开发者ID:Quent42340,项目名称:KubikDS,代码行数:33,代码来源:efs_lib.c


示例19: Initialize

bool bgGlobalMax::Initialize(Interface* p3DMax)
{
	m_p3DMax = p3DMax;
	m_pRootNode = p3DMax->GetRootNode();

	if (m_p3DMax == NULL && m_pRootNode == NULL)
		return false;
	if (CheckFile(m_p3DMax) == false)
		return true;

	m_Interval = m_p3DMax->GetAnimRange();

	memset(&m_Scene, 0, sizeof(m_Scene));
	m_Scene.iVersion = 100;
	m_Scene.iFirstFrame = m_Interval.Start() / GetTicksPerFrame();
	m_Scene.iLastFrame = m_Interval.End() / GetTicksPerFrame();
	m_Scene.iFrameSpeed = GetFrameRate();
	m_Scene.iTickPerFrame = GetTicksPerFrame();

	PreProcess(m_pRootNode);

	m_Scene.iNumMesh = m_MatrixMap.Count();
	m_Scene.iMaxWeight = 1;

	return true;
}
开发者ID:bingeun,项目名称:BG_DX,代码行数:26,代码来源:bgGlobalMax.cpp


示例20: LocateDir

std::string FileSystem::LocateDir(std::string _dir, int flags) const
{
	if (!CheckFile(_dir)) {
		return "";
	}

	// if it's an absolute path, don't look for it in the data directories
	if (FileSystemHandler::IsAbsolutePath(_dir)) {
		return _dir;
	}

	std::string dir = _dir;
	FixSlashes(dir);

	if (flags & WRITE) {
		std::string writeableDir = fs.GetWriteDir() + dir;
		FixSlashes(writeableDir);
		if (flags & CREATE_DIRS) {
			CreateDirectory(writeableDir);
		}
		return writeableDir;
	} else {
		const std::vector<std::string>& datadirs = fs.GetDataDirectories();
		std::vector<std::string>::const_iterator dd;
		for (dd = datadirs.begin(); dd != datadirs.end(); ++dd) {
			std::string dirPath((*dd) + dir);
			if (fs.DirExists(dirPath)) {
				return dirPath;
			}
		}
		return dir;
	}
}
开发者ID:SocietalEclipse,项目名称:spring-Societal,代码行数:33,代码来源:FileSystem.cpp



注:本文中的CheckFile函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CheckForAvailableArgumentSpace函数代码示例发布时间:2022-05-30
下一篇:
C++ CheckError函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap