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

C++ MakePath函数代码示例

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

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



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

示例1: sName

TYPE_File* ToppyFramework::Hdd_Fopen(char *name )
{
	CString sName(name);
	if ((sName.Find("/")!=-1) || (sName.Find("\\")!=-1))
	{
		LogError("Tried to open a file with a path in the name - %s", name);
        return 0;
	}

	FILE* handle = fopen(MakePath(name), "rb+"); // open for update
	if (handle == NULL)
	{
		LogError("Failed to open file %s", (LPCSTR) MakePath(name));
		return 0;
	}

	TYPE_File* pToppyHandle = new TYPE_File();
	ZeroMemory(pToppyHandle, sizeof(TYPE_File));
	strncpy(pToppyHandle->name, name, 100);

	m_mapOpenFiles[pToppyHandle] = handle;
	pToppyHandle->size = Hdd_Flen(pToppyHandle);

	LogInfo("Opened %s - handle 0x%x, TYPE_File 0x%x", (LPCSTR) MakePath(name), handle, pToppyHandle);

	pToppyHandle->startCluster = GetStartClusterHash(name);
	pToppyHandle->totalCluster = 0;
	// TODO: more initialization?
	return pToppyHandle;
}
开发者ID:BackupTheBerlios,项目名称:tap-svn,代码行数:30,代码来源:ToppyFramework.cpp


示例2: FullLoad

bool TRoss::FullLoad(const char* _RossPath)
{
	if (!LoadOnlyConstants(_RossPath))
		return false;

	if(!MakePath (RossPath, "Cortege.bin", CortegeFile))
	{
		 m_LastError = "cannot find Cortege.bin";
		 return false; 
	};
	if(!MakePath (RossPath, "Units.bin", UnitsFile) )
	{
		 m_LastError = "cannot find Units.bin";
		 return false; 
	};

	BuildUnits ();

	if(!BuildCorteges ())
	{
        m_LastError = "Cannot build corteges";
        return false; 
    }

	return true;
}
开发者ID:dkrotx,项目名称:gogo_lemmatizer,代码行数:26,代码来源:Ross.cpp


示例3: Cwd

void Cwd(char *param)
{
    char tmp[PATH_MAX];
    
    if (param[0] == '/') 
		MakePath(tmp, "", param); 
	else 
		MakePath(tmp, path, param);
    if (chdir(tmp) == -1) {
        Error(param);
    } else {
        if (getcwd(tmp, PATH_MAX) == NULL) 
			ERRS("Permission denied");
        else {
            if (anonymous_login) {
                if (strncmp(basedir, tmp, strlen(basedir)) != 0) {
                    chdir(basedir);
                    strcpy(path, "/");
                } else {
                    strncpy(path, &tmp[strlen(basedir)], PATH_MAX);
                    strcat(path, "/");
                };
            } else strcpy(path, tmp);
            outs("250 CWD command successful.");
        };
    };
};
开发者ID:github188,项目名称:SimpleCode,代码行数:27,代码来源:ftpserverdemo.c


示例4: switch

sBool sDIFile::SetAttr(sInt attr,void *data,sInt s)
{
  sChar path[sDI_PATHSIZE];
  sChar path2[sDI_PATHSIZE];
  sInt result;

  result = sTRUE;
  switch(attr)
  {
  case sDIA_NAME:
    MakePath(path);
    MakePath(path2,(sChar *)data);
    result = sSystem->RenameFile(path,path2);
    if(result)
      sCopyString(Name,(sChar *)data,sizeof(Name));
    break;
  case sDIA_DATA:
    MakePath(path);
    result = sSystem->SaveFile(path,(sU8 *)data,s);
    if(result)
      Size = s;
    else
      ;//Size = 0;   // need better error handling here!
    break;
  default:
    result = sFALSE;
    break;
  }
  return result;
}
开发者ID:Ambrevar,项目名称:fr_public,代码行数:30,代码来源:_diskitem.cpp


示例5: GetWindowRect

void CWndSelectAwakeCase::OnInitialUpdate() 
{ 
	CWndNeuz::OnInitialUpdate(); 
	
	// 여기에 코딩하세요

	// 윈도를 중앙으로 옮기는 부분.
	CRect rectRoot = m_pWndRoot->GetLayoutRect();
	CRect rectWindow = GetWindowRect();
	CPoint point( rectRoot.right - rectWindow.Width(), 110 );
	Move( point );
	MoveParentCenter();

	ItemProp* pProp = (ItemProp*)prj.GetItemProp( m_dwItemIndex );
	if( pProp )
		m_pTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ITEM, pProp->szIcon ), 0xffff00ff );
	
	m_pTexGuage = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_THEME, "Wndguage.tga"   ), 0xffff00ff );

	if( !m_pTexGuage )
		Error( "CWndSelectAwakeCase::OnInitialUpdate m_pTexGuage(Wndguage.tga) is NULL" );

	AddWndStyle( WBS_MODAL );

	RestoreDeviceObjects( );
} 
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:26,代码来源:WndAwakening.cpp


示例6: Initialize

/*
 * Initialize the process by reading environment variables and files
 */
static void Initialize(void)
{
    char *temp;
    ListOfString *fileList;
    int stateDirLen;
    /*
     * Process miscellaneous parameters from the initial environment.
     */
    checkpointThreshold =
            IntGetEnv(CKP_THRESHOLD_VAR, CKP_THRESHOLD_DEFAULT);
    cartHoldSeconds =
            IntGetEnv(CART_HOLD_MINUTES_VAR, CART_HOLD_MINUTES_DEFAULT)*60;
    /*
     * Create an empty in-memory shopping cart data structure.
     */
    cartTablePtr = &cartTable;
    Tcl_InitHashTable(cartTablePtr, TCL_STRING_KEYS);
    /*
     * Compute the state directory name from the initial environment
     * variables.
     */
    stateDir = getenv(STATE_DIR_VAR);
    stateDirLen = Strlen(stateDir);
    assert(stateDirLen > 0);
    if(stateDir[stateDirLen - 1] == '/') {
        stateDir[stateDirLen - 1] = '\000';
    }
    fcgiProcessId = getenv(PID_VAR);
    if(fcgiProcessId != NULL) {
        stateDir = StringCat4(stateDir, ".", fcgiProcessId, "/");
    } else {
        stateDir = StringCat(stateDir, "/");
    }
    /*
     * Read the state directory to determine the current
     * generation number and a list of files that may
     * need to be deleted (perhaps left over from an earlier
     * system crash).  Recover the current generation
     * snapshot and log (either or both may be missing),
     * populating the in-memory shopping cart data structure.
     * Take a checkpoint, making the current log empty.
     */
    AnalyzeStateDir(stateDir, SNP_PREFIX, &generation, &fileList);
    snapshotPath = MakePath(stateDir, SNP_PREFIX, generation);
    RecoverFile(snapshotPath);
    logPath = MakePath(stateDir, LOG_PREFIX, generation);
    numLogRecords = RecoverFile(logPath);
    Checkpoint();
    /*
     * Clean up stateDir without removing the current snapshot and log.
     */
    while(fileList != NULL) {
        char *cur = ListOfString_Head(fileList);
        if(strcmp(snapshotPath, cur) && strcmp(logPath, cur)) {
            remove(cur);
        }
        fileList = ListOfString_RemoveElement(fileList, cur);
    }
}
开发者ID:TVilaboa,项目名称:InvestigacionC,代码行数:62,代码来源:main.c


示例7: while

WORD ToppyFramework::Hdd_ChangeDir(char *dir )
{
	CString sChange = dir;
	if (sChange == ".")
		return 1;

	if (sChange.ReverseFind(L'/') == sChange.GetLength() -1)
	{
		return 0; // toppy doesn't like stuff ending with /
	}
	else
	{
		if (sChange.ReverseFind(L'.') == sChange.GetLength() - 1)
			sChange += "/"; // however this routine likes it so we put one on to make the code below simpler
	}


	while (sChange.Left(3) == "../")
	{
		if (m_sCurrentFolder == "/")
			return 1;

		int iTrim = m_sCurrentFolder.ReverseFind('/');
		if (iTrim >= 0)
			m_sCurrentFolder = m_sCurrentFolder.Left(iTrim);

		sChange = sChange.Mid(3);		
	}

	if (sChange.IsEmpty())
		return 1;

	word result = 1;

	CString sNewDir = MakePath(sChange);
	if (_access(sNewDir, 00) != 0)
	{
		result = 0;
		while (true)
		{
			int iTrim = sChange.ReverseFind('/');
			sChange = sChange.Left(iTrim);
			if (sChange.IsEmpty())
				break;

			sNewDir = MakePath(sChange);
			if (_access(sNewDir, 00) == 0)
				break;
		}
	}

	if (!sChange.IsEmpty())
		m_sCurrentFolder += "/";
	m_sCurrentFolder += sChange;
	return result;
}
开发者ID:BackupTheBerlios,项目名称:tap-svn,代码行数:56,代码来源:ToppyFramework.cpp


示例8: GetWindowRect

void CWndPartyCtrl::OnInitialUpdate()
{
	CRect rect = GetWindowRect();
	m_wndScrollBar.AddWndStyle( WBS_DOCKING );
	m_wndScrollBar.Create( WBS_VERT, rect, this, 1000 );//,m_pSprPack,-1);
	m_nFontHeight = 20;//GetFontHeight( &g_2DRender );

	RestoreDeviceObjects();
	m_texGauEmptyNormal.LoadTexture( m_pApp->m_pd3dDevice, MakePath( DIR_THEME, "GauEmptySmall.bmp" ), 0xffff00ff, TRUE );
	m_texGauFillNormal.LoadTexture( m_pApp->m_pd3dDevice, MakePath( DIR_THEME, "GauFillSmall.bmp" ), 0xffff00ff, TRUE );
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:11,代码来源:WndPartyCtrl.cpp


示例9: MakeUserRoot

string MakeUserRoot(string &userName)
{
	string path = GetEnvVar("USER_ROOT");
	if(path.empty())
	{
		path = USER_ROOT;
	}
	MakePath(path,userName);
	MakePath(path,"/home/wwwroot");
	return path;
}
开发者ID:xinll,项目名称:virtualhost,代码行数:11,代码来源:tools.cpp


示例10: MakePath

QString
WUploadThread::MakeUploadPath(MessageRef ref)
{
	QString filename;
	if (GetStringFromMessage(ref, "beshare:File Name", filename) == B_OK)
	{
		QString path;
		if (GetStringFromMessage(ref, "winshare:Path", path) == B_OK)
			return MakePath(path, filename);
		if (GetStringFromMessage(ref, "beshare:Path", path) == B_OK)
			return MakePath(path, filename);
	}
	return QString::null;
}
开发者ID:mtl1979,项目名称:unizone,代码行数:14,代码来源:uploadthread.cpp


示例11: ResetMap

void MysteryDungeonMaker::CreateDungeon()
{
	ResetMap();

	std::vector<Component> section_components;
	const size_t sectionRowNum = dungeonSize->DungeonRowNum();
	const size_t sectionColumnNum = dungeonSize->DungeonColumnNum();
	for (size_t i = 0; i < sectionRowNum; i++)
	{
		for (size_t j = 0; j < sectionColumnNum; j++)
		{
			section_components.push_back(Component(i, j));
			this->sections[i][j].SetComponent(i, j);
		}
	}

	std::random_device rd;
	shuffle(section_components.begin(), section_components.end(), std::mt19937_64(rd()));

	for (int i = 0; i < roomNum; i++)
	{
		int i_section = section_components[i].i;
		int j_section = section_components[i].j;

		int width = GetRandInRange(minRoomWidth, sectionColumnNum - 4);
		int height = GetRandInRange(minRoomHeight, sectionRowNum - 4);
		MakeRoom(Component(i_section, j_section), width, height);
	}
	MakePath();
}
开发者ID:kyorop,项目名称:KwsRogueLike,代码行数:30,代码来源:MysteryDungeonMaker.cpp


示例12: GetWndCtrl

BOOL  CWndBlessingCancel::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
{

	CItemElem* pTempElem;
	pTempElem  = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );

    if( g_xRandomOptionProperty->GetRandomOptionKind( pTempElem ) == CRandomOptionProperty::eBlessing
		&& g_xRandomOptionProperty->GetRandomOptionSize( pTempElem->GetRandomOptItemId() ))
	{
		// 하락 상태가 된 아이템만 올릴 수 있다. 
		if(pTempElem != NULL)
		{
			if(m_pItemElem) m_pItemElem->SetExtra(0);
			m_pItemElem = pTempElem;
			m_pEItemProp = m_pItemElem->GetProp();
			m_pItemElem->SetExtra(m_pItemElem->GetExtra()+1);
			CWndButton* pButton = (CWndButton*)GetDlgItem(WIDC_START);
			pButton->EnableWindow(TRUE);
			
			LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CHANGE );
			if(m_pEItemProp != NULL)
			{
				m_pTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ITEM, m_pEItemProp->szIcon), 0xffff00ff );
			}
		}
	}
	else
	{
		g_WndMng.PutString( prj.GetText(TID_GAME_BLESSEDNESS_CANCEL), NULL, 0xffff0000 );
		return FALSE;
	}

	return TRUE;

}
开发者ID:iceberry,项目名称:flyffsf,代码行数:35,代码来源:WndBlessingCancel.cpp


示例13: PreConnection

void PreConnection(char *param, char open_mode, int data_mode)
{
    char tmp[PATH_MAX];
    char mode[3];
    struct stat s;
    
    MakePath(tmp, path, param);
    mode[0] = open_mode;
    if (transfer_type == 'i') 
		mode[1] = 'b'; 
	else 
		mode[1] = 't';
    mode[2] = 0;
    
    if (data_mode && stat(tmp, &s) == -1) {
        Error(param);
        return;
    };
    if ((data_file = fopen(tmp, mode)) == NULL) {
        Error(param);
        return;
    };
    
    if (open_mode != 'a') 
		fseek(data_file, file_rest, SEEK_SET);
    if (data_mode) {
        sprintf(tmp, "%s (%d bytes)", param, (int)(s.st_size - file_rest));
    } else {
        strcpy(tmp, param);
    };
    
    DataConnection(data_mode, transfer_type, tmp);
};
开发者ID:github188,项目名称:SimpleCode,代码行数:33,代码来源:ftpserverdemo.c


示例14: LoadMapMonsterInformationPack

//-----------------------------------------------------------------------------
BOOL CMapInformationManager::LoadMapMonsterInformationPack( void )
{
	for( MapComboBoxDataVector::iterator Iterator = m_MapNameVector.begin(); Iterator != m_MapNameVector.end(); ++Iterator )
	{
		CMapComboBoxData* pMapComboBoxData = ( CMapComboBoxData* )( *Iterator );
		if( pMapComboBoxData == NULL )
		{
			continue;
		}

		if( pMapComboBoxData->GetMapMonsterInformationFileName() == _T( "" ) )
		{
			continue;
		}

		CMapMonsterInformationPack* pMapMonsterInformationPack = new CMapMonsterInformationPack;
		if( pMapMonsterInformationPack->LoadScript( MakePath( DIR_THEME, pMapComboBoxData->GetMapMonsterInformationFileName() ) ) == FALSE )
		{
			continue;
		}

		m_MapMonsterInformationPackMap[ pMapComboBoxData->GetID() ] = pMapMonsterInformationPack;
	}

	return TRUE;
}
开发者ID:KerwinMa,项目名称:SourceFlyFF,代码行数:27,代码来源:MapInformationManager.cpp


示例15: abs

bool BackupMgr::SaveBackup(SciDoc*sci)
{
  FXString savename;
  FXString untitled;
  untitled.format(FN_FMT, backupdir.text(), abs(getpid()), SciDocUtils::ID(sci));
  if (SciDocUtils::Filename(sci).empty()) {
    savename=untitled;
  } else {
    if (FXStat::isFile(untitled)) {
      RemoveBackup(untitled);
    }
#ifdef WIN32
    savename=SciDocUtils::Filename(sci).text();
    savename.substitute(':', '%', true);
    savename.prepend(backupdir.text());
#else
    savename.format("%s%s", backupdir.text(), SciDocUtils::Filename(sci).text());
#endif
  }
  if (MakePath(FXPath::directory(savename))) {
    if (SciDocUtils::SaveToFile(sci,savename.text(),false)) {
      SciDocUtils::NeedBackup(sci, false);
      return true;
    } else {
      lasterror=SciDocUtils::GetLastError(sci);
      ErrorMessage(_("Failed to save backup"), savename);
      return false;
    }
  } else {
    return false;
  }
}
开发者ID:gahr,项目名称:fxite,代码行数:32,代码来源:backup.cpp


示例16: SplitPath

void FileMisc::ReplaceExtension(CString& sFilePath, const TCHAR* szExt)
{
	CString sDrive, sDir, sFile;

	SplitPath(sFilePath, &sDrive, &sDir, &sFile);
	MakePath(sFilePath, sDrive, sDir, sFile, szExt);
}
开发者ID:noindom99,项目名称:repositorium,代码行数:7,代码来源:FileMisc.cpp


示例17: MakePath

BOOL CWndLvReqDown::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
{
	
	CItemElem* pTempElem;
	pTempElem  = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );

	// 하락 상태가 된 아이템만 올릴 수 있다. 
	if( pTempElem != NULL)
	{
		if(pTempElem->GetLevelDown() < 0)
		{
			if(m_pItemElem) m_pItemElem->SetExtra(0);
			m_pItemElem = pTempElem;
			m_pEItemProp = m_pItemElem->GetProp();
			if(m_pEItemProp != NULL)
			{
				m_pTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ITEM, m_pEItemProp->szIcon), 0xffff00ff );
			}
			m_pItemElem->SetExtra(m_pItemElem->GetExtra()+1);
			CWndButton* pButton = (CWndButton*)GetDlgItem(WIDC_BUTTON1);
			pButton->EnableWindow(TRUE);
		}
	}

	return TRUE;
}
开发者ID:domz1,项目名称:SourceFlyFF,代码行数:26,代码来源:WndLvReqDown.cpp


示例18: CRect

void CWndPvpBase::OnInitialUpdate()
{
    CWndBase::OnInitialUpdate();

    int y = 105;
    if( g_pPlayer->IsAuthHigher( AUTH_GAMEMASTER ) )
        m_wndChangeJob.Create( ">", 0, CRect( 135, y, 135+40, y + 13 ), this, 10  );

#if __VER >= 9 // __CSC_VER9_2
    SetTexture( m_pApp->m_pd3dDevice, MakePath( "Data\\Theme\\", ::GetLanguage(), _T( "WndPvP2.tga" ) ), TRUE );
#else //__CSC_VER9_2
    SetTexture( m_pApp->m_pd3dDevice, MakePath( "Data\\Theme\\", ::GetLanguage(), _T( "wndPvP.tga" ) ), TRUE );
#endif //__CSC_VER9_2

    FitTextureSize();
}
开发者ID:karlito59,项目名称:FlyFF,代码行数:16,代码来源:WndPvp.cpp


示例19: switch

/*
	BrowseDlg用 WM_COMMAND 処理
*/
BOOL TBrowseDirDlg::EvCommand(WORD wNotifyCode, WORD wID, LPARAM hwndCtl)
{
	switch (wID) {
	case MKDIR_BUTTON:
		{
			char		dirBuf[MAX_PATH], path[MAX_PATH];
			TInputDlg	dlg(dirBuf, this);
			if (dlg.Exec() != IDOK)
				return	TRUE;

			MakePath(path, fileBuf, dirBuf);
			if (::CreateDirectory(path, NULL)) {
				strcpy(fileBuf, path);
				dirtyFlg = TRUE;
				PostMessage(WM_CLOSE, 0, 0);
			}
		}
		return	TRUE;

	case RMDIR_BUTTON:
		if (::RemoveDirectory(fileBuf)) {
			GetParentDir(fileBuf, fileBuf);
			dirtyFlg = TRUE;
			PostMessage(WM_CLOSE, 0, 0);
		}
		return	TRUE;
	}
	return	FALSE;
}
开发者ID:MakiseKurisu,项目名称:FastCopy,代码行数:32,代码来源:install.cpp


示例20: ShellExtFunc

int ShellExtFunc(char *setup_dir, ShellExtOpe kind)
{
	char	buf[MAX_PATH];
	int		ret = FALSE;

	MakePath(buf, setup_dir, CURRENT_SHEXTDLL);
	HMODULE		hShellExtDll = TLoadLibrary(buf);

	if (hShellExtDll) {
		BOOL (WINAPI *IsRegisterDll)(void) = (BOOL (WINAPI *)(void))
			GetProcAddress(hShellExtDll, "IsRegistServer");
		HRESULT (WINAPI *UnRegisterDll)(void) = (HRESULT (WINAPI *)(void))
			GetProcAddress(hShellExtDll, "DllUnregisterServer");

		if (IsRegisterDll && UnRegisterDll) {
			switch (kind) {
			case CHECK_SHELLEXT:
				ret = IsRegisterDll();
				break;
			case UNREGISTER_SHELLEXT:
				ret = UnRegisterDll();
				break;
			}
		::FreeLibrary(hShellExtDll);
		}
	}
	return	ret;
}
开发者ID:MakiseKurisu,项目名称:FastCopy,代码行数:28,代码来源:install.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ MakePlayerNotFound函数代码示例发布时间:2022-05-30
下一篇:
C++ MakeParameters函数代码示例发布时间: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