您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetFilePath函数代码示例

51自学网 2021-06-01 21:07:51
  C++
这篇教程C++ GetFilePath函数代码示例写得很实用,希望能帮到您。

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

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

示例1: MirrorSetAllocationSize

static NTSTATUS DOKAN_CALLBACK MirrorSetAllocationSize(    LPCWSTR FileName, LONGLONG AllocSize, PDOKAN_FILE_INFO DokanFileInfo) {  WCHAR filePath[MAX_PATH];  HANDLE handle;  LARGE_INTEGER fileSize;  GetFilePath(filePath, MAX_PATH, FileName);  DbgPrint(L"SetAllocationSize %s, %I64d/n", filePath, AllocSize);  handle = (HANDLE)DokanFileInfo->Context;  if (!handle || handle == INVALID_HANDLE_VALUE) {    DbgPrint(L"/tinvalid handle/n/n");    return STATUS_INVALID_HANDLE;  }  if (GetFileSizeEx(handle, &fileSize)) {    if (AllocSize < fileSize.QuadPart) {      fileSize.QuadPart = AllocSize;      if (!SetFilePointerEx(handle, fileSize, NULL, FILE_BEGIN)) {        DWORD error = GetLastError();        DbgPrint(L"/tSetAllocationSize: SetFilePointer eror: %d, "                 L"offset = %I64d/n/n",                 error, AllocSize);        return ToNtStatus(error);      }      if (!SetEndOfFile(handle)) {        DWORD error = GetLastError();        DbgPrint(L"/tSetEndOfFile error code = %d/n/n", error);        return ToNtStatus(error);      }    }  } else {    DWORD error = GetLastError();    DbgPrint(L"/terror code = %d/n/n", error);    return ToNtStatus(error);  }  return STATUS_SUCCESS;}
开发者ID:JangWonWoong,项目名称:dokany,代码行数:39,


示例2: throw

bool emAvFileModel::TryContinueLoading() throw(emString){	switch (GetStreamState()) {	case STREAM_CLOSED:		OpenStream("none","none",GetFilePath());		return false;	case STREAM_OPENED:		CloseStream();		PlayPos=0;		AudioVolume=100;		AudioMute=false;		LoadAudioVolume();		LoadAudioVisu();		LoadFileState();		return true;	case STREAM_ERRORED:		throw emString(GetStreamErrorText());	default:		emSleepMS(10);		return false;	}}
开发者ID:ackalker,项目名称:eaglemode,代码行数:22,


示例3: MirrorFlushFileBuffers

static NTSTATUS DOKAN_CALLBACKMirrorFlushFileBuffers(LPCWSTR FileName, PDOKAN_FILE_INFO DokanFileInfo) {  WCHAR filePath[MAX_PATH];  HANDLE handle = (HANDLE)DokanFileInfo->Context;  GetFilePath(filePath, MAX_PATH, FileName);  DbgPrint(L"FlushFileBuffers : %s/n", filePath);  if (!handle || handle == INVALID_HANDLE_VALUE) {    DbgPrint(L"/tinvalid handle/n/n");    return STATUS_SUCCESS;  }  if (FlushFileBuffers(handle)) {    return STATUS_SUCCESS;  } else {    DWORD error = GetLastError();    DbgPrint(L"/tflush error code = %d/n", error);    return ToNtStatus(error);  }}
开发者ID:JangWonWoong,项目名称:dokany,代码行数:22,


示例4: item

/*----------------------------------------------------------------------|   PLT_FileMediaServer::OnBrowseMetadata+---------------------------------------------------------------------*/NPT_ResultPLT_FileMediaServer::OnBrowseMetadata(PLT_ActionReference& action,                                       const char*          object_id,                                       NPT_SocketInfo*      info /* = NULL */){    NPT_String didl;    /* locate the file from the object ID */    NPT_String filepath;    if (NPT_FAILED(GetFilePath(object_id, filepath))) {        /* error */        NPT_LOG_WARNING("PLT_FileMediaServer::OnBrowse - ObjectID not found.");        action->SetError(701, "No Such Object.");        return NPT_FAILURE;    }    NPT_Reference<PLT_MediaObject> item(BuildFromFilePath(filepath, true, info));    if (item.IsNull()) return NPT_FAILURE;    NPT_String filter;    NPT_CHECK_SEVERE(action->GetArgumentValue("Filter", filter));    NPT_String tmp;        NPT_CHECK_SEVERE(PLT_Didl::ToDidl(*item.AsPointer(), filter, tmp));    /* add didl header and footer */    didl = didl_header + tmp + didl_footer;    NPT_CHECK_SEVERE(action->SetArgumentValue("Result", didl));    NPT_CHECK_SEVERE(action->SetArgumentValue("NumberReturned", "1"));    NPT_CHECK_SEVERE(action->SetArgumentValue("TotalMatches", "1"));    // update ID may be wrong here, it should be the one of the container?    NPT_CHECK_SEVERE(action->SetArgumentValue("UpdateId", "1"));    // TODO: We need to keep track of the overall updateID of the CDS    return NPT_SUCCESS;}
开发者ID:Avoidnf8,项目名称:xbmc-fork,代码行数:41,


示例5: MirrorSetFileAttributes

static int DOKAN_CALLBACKMirrorSetFileAttributes(	LPCWSTR				FileName,	DWORD				FileAttributes,	PDOKAN_FILE_INFO	DokanFileInfo){    UNREFERENCED_PARAMETER(DokanFileInfo);	WCHAR	filePath[MAX_PATH];		GetFilePath(filePath, MAX_PATH, FileName);	DbgPrint(L"SetFileAttributes %s/n", filePath);	if (!SetFileAttributes(filePath, FileAttributes)) {		DWORD error = GetLastError();		DbgPrint(L"/terror code = %d/n/n", error);		return error * -1;	}	DbgPrint(L"/n");	return 0;}
开发者ID:jdstroy,项目名称:dokany,代码行数:23,


示例6: LogError

QVariant ConfigAPI::Read(QString file, QString section, QString key, const QVariant &defaultValue) const{    if (configFolder_.isEmpty())    {        LogError("ConfigAPI::Read: Config folder has not been prepared, returning null QVariant.");        return "";    }    PrepareString(file);    PrepareString(section);    PrepareString(key);    // Don't return 'defaultValue' but null QVariant    // as this is an error situation.    if (!IsFilePathSecure(file))        return QVariant();    QSettings config(GetFilePath(file), QSettings::IniFormat);    if (section.isEmpty())        return config.value(key, defaultValue);    else        return config.value(section + "/" + key, defaultValue);}
开发者ID:360degrees-fi,项目名称:tundra,代码行数:23,


示例7: Navigate

BOOL CBrowserView::RefreshView(){	CBonfireDoc* pDoc = (CBonfireDoc*)GetDocument();	CString docPath = pDoc->GetPathName();	if (!pDoc->IsModified())	{		// display the file in the browser viewer		Navigate(docPath);	}	else	{		CString	strAbsPath	= theApp.m_pszHelpFilePath;		DWORD	nSize		= 128;		char*	lpValue		= (char*)malloc( nSize );		int		retVal		= GetEnvironmentVariable("TEMP", lpValue, nSize);		if (retVal <= (int)nSize)			strAbsPath = lpValue;		else if (retVal == 0)		{			// try TMP			retVal			= GetEnvironmentVariable("TMP", lpValue, nSize);			if (retVal <= (int)nSize)				strAbsPath = lpValue;		}		// generate a temp file		CString navPath = GetFilePath( AddSlash(strAbsPath) ) + "btmp_" + GetFileTitle( docPath );		pDoc->m_xTextBuffer.SaveToFile(navPath, CRLF_STYLE_AUTOMATIC, FALSE);		// mark the file as temporary for later deletion		theApp.AddTempFile( navPath );		// display the file in the browser viewer		Navigate(navPath);	}	return TRUE;}
开发者ID:Qeeet,项目名称:nz-software,代码行数:37,


示例8: MirrorUnlockFile

static intMirrorUnlockFile(	LPCWSTR				FileName,	LONGLONG			ByteOffset,	LONGLONG			Length,	PDOKAN_FILE_INFO	DokanFileInfo){	WCHAR	filePath[MAX_PATH+1];	HANDLE	handle;	LARGE_INTEGER	length;	LARGE_INTEGER	offset;	GetFilePath(filePath, FileName);	DbgPrint(L"UnlockFile %s/n", filePath);    /*	handle = (HANDLE)DokanFileInfo->Context;	if (!handle || handle == INVALID_HANDLE_VALUE) {		DbgPrint(L"/tinvalid handle/n/n");		return -1;	}	length.QuadPart = Length;	offset.QuadPart = ByteOffset;	if (UnlockFile(handle, offset.HighPart, offset.LowPart, length.HighPart, length.LowPart)) {		DbgPrint(L"/tsuccess/n/n");		return 0;	} else {		DbgPrint(L"/tfail/n/n");		return -1;	}    */    return 0;}
开发者ID:yusukei,项目名称:CacheFS,代码行数:36,


示例9: GetFilePath

nsresult nsNntpUrl::ParseNewsURL(){  // The path here is the group/msgid portion  nsAutoCString path;  nsresult rv = GetFilePath(path);  NS_ENSURE_SUCCESS(rv, rv);  // Drop the potential beginning from the path  if (path.Length() && path[0] == '/')    path = Substring(path, 1);  // The presence of an `@' is a sign we have a msgid  if (path.Find("@") != -1 || path.Find("%40") != -1)  {    MsgUnescapeString(path, 0, m_messageID);    // Set group, key for ?group=foo&key=123 uris    nsAutoCString spec;    GetSpec(spec);    int32_t groupPos = spec.Find(kNewsURIGroupQuery); // find ?group=    int32_t keyPos   = spec.Find(kNewsURIKeyQuery);   // find &key=    if (groupPos != kNotFound && keyPos != kNotFound)    {      // get group name and message key      m_group = Substring(spec, groupPos + kNewsURIGroupQueryLen,                          keyPos - groupPos - kNewsURIGroupQueryLen);      nsCString keyStr(Substring(spec, keyPos + kNewsURIKeyQueryLen));      m_key = keyStr.ToInteger(&rv, 10);      NS_ENSURE_SUCCESS(rv, NS_ERROR_MALFORMED_URI);    }  }  else    MsgUnescapeString(path, 0, m_group);  return NS_OK;}
开发者ID:MoonchildProductions,项目名称:FossaMail,代码行数:36,


示例10: MirrorSetEndOfFile

static NTSTATUS DOKAN_CALLBACKMirrorSetEndOfFile(	LPCWSTR				FileName,	LONGLONG			ByteOffset,	PDOKAN_FILE_INFO	DokanFileInfo){	WCHAR			filePath[MAX_PATH];	HANDLE			handle;	LARGE_INTEGER	offset;	GetFilePath(filePath, MAX_PATH, FileName);	DbgPrint(L"SetEndOfFile %s, %I64d/n", filePath, ByteOffset);	handle = (HANDLE)DokanFileInfo->Context;	if (!handle || handle == INVALID_HANDLE_VALUE) {		DbgPrint(L"/tinvalid handle/n/n");		return STATUS_INVALID_HANDLE;	}	offset.QuadPart = ByteOffset;	if (!SetFilePointerEx(handle, offset, NULL, FILE_BEGIN)) {		DWORD error = GetLastError();		DbgPrint(L"/tSetFilePointer error: %d, offset = %I64d/n/n",			error, ByteOffset);		return ToNtStatus(error);	}	if (!SetEndOfFile(handle)) {		DWORD error = GetLastError();		DbgPrint(L"/tSetEndOfFile error code = %d/n/n", error);		return ToNtStatus(error);	}	return STATUS_SUCCESS;}
开发者ID:KadriUmay,项目名称:dokany,代码行数:36,


示例11: MirrorCleanup

static void DOKAN_CALLBACKMirrorCleanup(	LPCWSTR					FileName,	PDOKAN_FILE_INFO		DokanFileInfo){	WCHAR filePath[MAX_PATH];	GetFilePath(filePath, MAX_PATH, FileName);	if (DokanFileInfo->Context) {		DbgPrint(L"Cleanup: %s/n/n", filePath);		CloseHandle((HANDLE)DokanFileInfo->Context);		DokanFileInfo->Context = 0;		if (DokanFileInfo->DeleteOnClose) {			DbgPrint(L"/tDeleteOnClose/n");			if (DokanFileInfo->IsDirectory) {				DbgPrint(L"  DeleteDirectory ");				if (!RemoveDirectory(filePath)) {					DbgPrint(L"error code = %d/n/n", GetLastError());				} else {					DbgPrint(L"success/n/n");				}			} else {				DbgPrint(L"  DeleteFile ");				if (DeleteFile(filePath) == 0) {					DbgPrint(L" error code = %d/n/n", GetLastError());				} else {					DbgPrint(L"success/n/n");				}			}		}	} else {		DbgPrint(L"Cleanup: %s/n/tinvalid handle/n/n", filePath);	}}
开发者ID:KadriUmay,项目名称:dokany,代码行数:36,


示例12: MirrorEnumerateNamedStreams

static int DOKAN_CALLBACKMirrorEnumerateNamedStreams(	LPCWSTR					FileName,	PVOID*					EnumContext,	LPWSTR					StreamName,	PULONG					StreamNameLength,	PLONGLONG				StreamSize,	PDOKAN_FILE_INFO		DokanFileInfo){	HANDLE	handle;	WCHAR	filePath[MAX_PATH];	GetFilePath(filePath, MAX_PATH, FileName);	DbgPrint(L"EnumerateNamedStreams %s/n", filePath);	handle = (HANDLE)DokanFileInfo->Context;	if (!handle || handle == INVALID_HANDLE_VALUE) {		DbgPrint(L"/tinvalid handle/n/n");		return -1;	}	// As we are requested one by one, it would be better to use FindFirstStream / FindNextStream instead of requesting all streams each time	// But this doesn't really matter on mirror sample	BYTE InfoBlock[64 * 1024];	PFILE_STREAM_INFORMATION pStreamInfo = (PFILE_STREAM_INFORMATION)InfoBlock;	IO_STATUS_BLOCK ioStatus;	ZeroMemory(InfoBlock, sizeof(InfoBlock));	NTSTATUS status = NtQueryInformationFile(handle, &ioStatus, InfoBlock, sizeof(InfoBlock), FileStreamInformation);	if (status != STATUS_SUCCESS) {		DbgPrint(L"/tNtQueryInformationFile failed with %d./n", status);		return -1;	}	if (pStreamInfo->StreamNameLength == 0) {		DbgPrint(L"/tNo stream found./n");		return -1;	}	UINT index = (UINT)*EnumContext;	DbgPrint(L"/tStream #%d requested./n", index);		for (UINT i = 0; i != index; ++i) {		if (pStreamInfo->NextEntryOffset == 0) {			DbgPrint(L"/tNo more stream./n");			return -1;		}		pStreamInfo = (PFILE_STREAM_INFORMATION) ((LPBYTE)pStreamInfo + pStreamInfo->NextEntryOffset);   // Next stream record	}	wcscpy_s(StreamName, SHRT_MAX + 1, pStreamInfo->StreamName);	*StreamNameLength = pStreamInfo->StreamNameLength;	*StreamSize = pStreamInfo->StreamSize.QuadPart;	DbgPrint(L"/t Stream %ws/n", pStreamInfo->StreamName);	// Remember next stream entry index	*EnumContext = (PVOID)++index;	return 0;}
开发者ID:jdstroy,项目名称:dokany,代码行数:62,


示例13: MirrorCreateFile

static int DOKAN_CALLBACKMirrorCreateFile(	LPCWSTR					FileName,	DWORD					AccessMode,	DWORD					ShareMode,	DWORD					CreationDisposition,	DWORD					FlagsAndAttributes,	PDOKAN_FILE_INFO		DokanFileInfo){	WCHAR filePath[MAX_PATH];	HANDLE handle;	DWORD fileAttr;	GetFilePath(filePath, MAX_PATH, FileName);	DbgPrint(L"CreateFile : %s/n", filePath);	PrintUserName(DokanFileInfo);	if (CreationDisposition == CREATE_NEW)		DbgPrint(L"/tCREATE_NEW/n");	if (CreationDisposition == OPEN_ALWAYS)		DbgPrint(L"/tOPEN_ALWAYS/n");	if (CreationDisposition == CREATE_ALWAYS)		DbgPrint(L"/tCREATE_ALWAYS/n");	if (CreationDisposition == OPEN_EXISTING)		DbgPrint(L"/tOPEN_EXISTING/n");	if (CreationDisposition == TRUNCATE_EXISTING)		DbgPrint(L"/tTRUNCATE_EXISTING/n");	/*	if (ShareMode == 0 && AccessMode & FILE_WRITE_DATA)		ShareMode = FILE_SHARE_WRITE;	else if (ShareMode == 0)		ShareMode = FILE_SHARE_READ;	*/	DbgPrint(L"/tShareMode = 0x%x/n", ShareMode);	MirrorCheckFlag(ShareMode, FILE_SHARE_READ);	MirrorCheckFlag(ShareMode, FILE_SHARE_WRITE);	MirrorCheckFlag(ShareMode, FILE_SHARE_DELETE);	DbgPrint(L"/tAccessMode = 0x%x/n", AccessMode);	MirrorCheckFlag(AccessMode, GENERIC_READ);	MirrorCheckFlag(AccessMode, GENERIC_WRITE);	MirrorCheckFlag(AccessMode, GENERIC_EXECUTE);		MirrorCheckFlag(AccessMode, DELETE);	MirrorCheckFlag(AccessMode, FILE_READ_DATA);	MirrorCheckFlag(AccessMode, FILE_READ_ATTRIBUTES);	MirrorCheckFlag(AccessMode, FILE_READ_EA);	MirrorCheckFlag(AccessMode, READ_CONTROL);	MirrorCheckFlag(AccessMode, FILE_WRITE_DATA);	MirrorCheckFlag(AccessMode, FILE_WRITE_ATTRIBUTES);	MirrorCheckFlag(AccessMode, FILE_WRITE_EA);	MirrorCheckFlag(AccessMode, FILE_APPEND_DATA);	MirrorCheckFlag(AccessMode, WRITE_DAC);	MirrorCheckFlag(AccessMode, WRITE_OWNER);	MirrorCheckFlag(AccessMode, SYNCHRONIZE);	MirrorCheckFlag(AccessMode, FILE_EXECUTE);	MirrorCheckFlag(AccessMode, STANDARD_RIGHTS_READ);	MirrorCheckFlag(AccessMode, STANDARD_RIGHTS_WRITE);	MirrorCheckFlag(AccessMode, STANDARD_RIGHTS_EXECUTE);		// When filePath is a directory, needs to change the flag so that the file can be opened.	fileAttr = GetFileAttributes(filePath);	if (fileAttr != INVALID_FILE_ATTRIBUTES && fileAttr & FILE_ATTRIBUTE_DIRECTORY) {		FlagsAndAttributes |= FILE_FLAG_BACKUP_SEMANTICS;		//AccessMode = 0;	}	DbgPrint(L"/tFlagsAndAttributes = 0x%x/n", FlagsAndAttributes);	MirrorCheckFlag(FlagsAndAttributes, FILE_ATTRIBUTE_ARCHIVE);	MirrorCheckFlag(FlagsAndAttributes, FILE_ATTRIBUTE_ENCRYPTED);	MirrorCheckFlag(FlagsAndAttributes, FILE_ATTRIBUTE_HIDDEN);	MirrorCheckFlag(FlagsAndAttributes, FILE_ATTRIBUTE_NORMAL);	MirrorCheckFlag(FlagsAndAttributes, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED);	MirrorCheckFlag(FlagsAndAttributes, FILE_ATTRIBUTE_OFFLINE);	MirrorCheckFlag(FlagsAndAttributes, FILE_ATTRIBUTE_READONLY);	MirrorCheckFlag(FlagsAndAttributes, FILE_ATTRIBUTE_SYSTEM);	MirrorCheckFlag(FlagsAndAttributes, FILE_ATTRIBUTE_TEMPORARY);	MirrorCheckFlag(FlagsAndAttributes, FILE_FLAG_WRITE_THROUGH);	MirrorCheckFlag(FlagsAndAttributes, FILE_FLAG_OVERLAPPED);	MirrorCheckFlag(FlagsAndAttributes, FILE_FLAG_NO_BUFFERING);	MirrorCheckFlag(FlagsAndAttributes, FILE_FLAG_RANDOM_ACCESS);	MirrorCheckFlag(FlagsAndAttributes, FILE_FLAG_SEQUENTIAL_SCAN);	MirrorCheckFlag(FlagsAndAttributes, FILE_FLAG_DELETE_ON_CLOSE);	MirrorCheckFlag(FlagsAndAttributes, FILE_FLAG_BACKUP_SEMANTICS);	MirrorCheckFlag(FlagsAndAttributes, FILE_FLAG_POSIX_SEMANTICS);	MirrorCheckFlag(FlagsAndAttributes, FILE_FLAG_OPEN_REPARSE_POINT);	MirrorCheckFlag(FlagsAndAttributes, FILE_FLAG_OPEN_NO_RECALL);	MirrorCheckFlag(FlagsAndAttributes, SECURITY_ANONYMOUS);	MirrorCheckFlag(FlagsAndAttributes, SECURITY_IDENTIFICATION);	MirrorCheckFlag(FlagsAndAttributes, SECURITY_IMPERSONATION);	MirrorCheckFlag(FlagsAndAttributes, SECURITY_DELEGATION);	MirrorCheckFlag(FlagsAndAttributes, SECURITY_CONTEXT_TRACKING);	MirrorCheckFlag(FlagsAndAttributes, SECURITY_EFFECTIVE_ONLY);	MirrorCheckFlag(FlagsAndAttributes, SECURITY_SQOS_PRESENT);//.........这里部分代码省略.........
开发者ID:jdstroy,项目名称:dokany,代码行数:101,


示例14: GetFreeDisk

Int64 GetFreeDisk(const char *FileName){#ifdef _WIN_32  char Root[NM];  GetPathRoot(FileName,Root);  typedef BOOL (WINAPI *GETDISKFREESPACEEX)(    LPCTSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER   );  static GETDISKFREESPACEEX pGetDiskFreeSpaceEx=NULL;  if (pGetDiskFreeSpaceEx==NULL)  {    HMODULE hKernel=GetModuleHandle("kernel32.dll");    if (hKernel!=NULL)      pGetDiskFreeSpaceEx=(GETDISKFREESPACEEX)GetProcAddress(hKernel,"GetDiskFreeSpaceExA");  }  if (pGetDiskFreeSpaceEx!=NULL)  {    GetFilePath(FileName,Root);    ULARGE_INTEGER uiTotalSize,uiTotalFree,uiUserFree;    uiUserFree.u.LowPart=uiUserFree.u.HighPart=0;    if (pGetDiskFreeSpaceEx(*Root ? Root:NULL,&uiUserFree,&uiTotalSize,&uiTotalFree) &&        uiUserFree.u.HighPart<=uiTotalFree.u.HighPart)      return(int32to64(uiUserFree.u.HighPart,uiUserFree.u.LowPart));  }  DWORD SectorsPerCluster,BytesPerSector,FreeClusters,TotalClusters;  if (!GetDiskFreeSpace(*Root ? Root:NULL,&SectorsPerCluster,&BytesPerSector,&FreeClusters,&TotalClusters))    return(1457664);  Int64 FreeSize=SectorsPerCluster*BytesPerSector;  FreeSize=FreeSize*FreeClusters;  return(FreeSize);#elif defined(_BEOS)  char Root[NM];  GetFilePath(FileName,Root);  dev_t Dev=dev_for_path(*Root ? Root:".");  if (Dev<0)    return(1457664);  fs_info Info;  if (fs_stat_dev(Dev,&Info)!=0)    return(1457664);  Int64 FreeSize=Info.block_size;  FreeSize=FreeSize*Info.free_blocks;  return(FreeSize);#elif defined(_UNIX)  return(1457664);#elif defined(_EMX)  int Drive=(!isalpha(FileName[0]) || FileName[1]!=':') ? 0:toupper(FileName[0])-'A'+1;  if (_osmode == OS2_MODE)  {    FSALLOCATE fsa;    if (DosQueryFSInfo(Drive,1,&fsa,sizeof(fsa))!=0)      return(1457664);    Int64 FreeSize=fsa.cSectorUnit*fsa.cbSector;    FreeSize=FreeSize*fsa.cUnitAvail;    return(FreeSize);  }  else  {    union REGS regs,outregs;    memset(&regs,0,sizeof(regs));    regs.h.ah=0x36;    regs.h.dl=Drive;    _int86 (0x21,&regs,&outregs);    if (outregs.x.ax==0xffff)      return(1457664);    Int64 FreeSize=outregs.x.ax*outregs.x.cx;    FreeSize=FreeSize*outregs.x.bx;    return(FreeSize);  }#else  #define DISABLEAUTODETECT  return(1457664);#endif}
开发者ID:zachberger,项目名称:UnRarX,代码行数:76,


示例15: GetFilePath

int svlFilterVideoFileWriter::GetFilePath(std::string &filepath, unsigned int videoch) const{    filepath = GetFilePath(videoch);    if (filepath.empty()) return SVL_FAIL;    return SVL_OK;}
开发者ID:Shuyoung,项目名称:cisst,代码行数:6,


示例16: MirrorGetFileInformation

static int DOKAN_CALLBACKMirrorGetFileInformation(	LPCWSTR							FileName,	LPBY_HANDLE_FILE_INFORMATION	HandleFileInformation,	PDOKAN_FILE_INFO				DokanFileInfo){	WCHAR	filePath[MAX_PATH];	HANDLE	handle = (HANDLE)DokanFileInfo->Context;	BOOL	opened = FALSE;	GetFilePath(filePath, MAX_PATH, FileName);	DbgPrint(L"GetFileInfo : %s/n", filePath);	if (!handle || handle == INVALID_HANDLE_VALUE) {		DbgPrint(L"/tinvalid handle/n/n");		// If CreateDirectory returned FILE_ALREADY_EXISTS and 		// it is called with FILE_OPEN_IF, that handle must be opened.		handle = CreateFile(filePath, 0, FILE_SHARE_READ, NULL, OPEN_EXISTING,			FILE_FLAG_BACKUP_SEMANTICS, NULL);		if (handle == INVALID_HANDLE_VALUE)			return -1;		opened = TRUE;	}	if (!GetFileInformationByHandle(handle,HandleFileInformation)) {		DbgPrint(L"/terror code = %d/n", GetLastError());		// FileName is a root directory		// in this case, FindFirstFile can't get directory information		if (wcslen(FileName) == 1) {			DbgPrint(L"  root dir/n");			HandleFileInformation->dwFileAttributes = GetFileAttributes(filePath);		} else {			WIN32_FIND_DATAW find;			ZeroMemory(&find, sizeof(WIN32_FIND_DATAW));			handle = FindFirstFile(filePath, &find);			if (handle == INVALID_HANDLE_VALUE) {				DbgPrint(L"/tFindFirstFile error code = %d/n/n", GetLastError());				return -1;			}			HandleFileInformation->dwFileAttributes = find.dwFileAttributes;			HandleFileInformation->ftCreationTime = find.ftCreationTime;			HandleFileInformation->ftLastAccessTime = find.ftLastAccessTime;			HandleFileInformation->ftLastWriteTime = find.ftLastWriteTime;			HandleFileInformation->nFileSizeHigh = find.nFileSizeHigh;			HandleFileInformation->nFileSizeLow = find.nFileSizeLow;			DbgPrint(L"/tFindFiles OK, file size = %d/n", find.nFileSizeLow);			FindClose(handle);		}	} else {		DbgPrint(L"/tGetFileInformationByHandle success, file size = %d/n",			HandleFileInformation->nFileSizeLow);	}	DbgPrint(L"/n");	if (opened) {		CloseHandle(handle);	}	return 0;}
开发者ID:jdstroy,项目名称:dokany,代码行数:65,


示例17: CPLError

//.........这里部分代码省略.........    /* Get equivalent number of looks */    poDS->SetMetadataItem( "AZIMUTH_LOOKS", CPLGetXMLValue( psProductInfo,        "imageDataInfo.imageRaster.azimuthLooks", "unknown" ) );    poDS->SetMetadataItem( "RANGE_LOOKS", CPLGetXMLValue( psProductInfo,        "imageDataInfo.imageRaster.rangeLooks", "unknown" ) );    const char *pszProductVariant = CPLGetXMLValue( psProductInfo,        "productVariantInfo.productVariant", "unknown" );    poDS->SetMetadataItem( "PRODUCT_VARIANT", pszProductVariant );    /* Determine what product variant this is */    if (STARTS_WITH_CI(pszProductVariant, "SSC"))        poDS->nProduct = eSSC;    else if (STARTS_WITH_CI(pszProductVariant, "MGD"))        poDS->nProduct = eMGD;    else if (STARTS_WITH_CI(pszProductVariant, "EEC"))        poDS->nProduct = eEEC;    else if (STARTS_WITH_CI(pszProductVariant, "GEC"))        poDS->nProduct = eGEC;    else        poDS->nProduct = eUnknown;    /* Start reading in the product components */    char *pszGeorefFile = NULL;    CPLErr geoTransformErr=CE_Failure;    for ( CPLXMLNode *psComponent = psComponents->psChild;          psComponent != NULL;          psComponent = psComponent->psNext)    {        const char *pszType = NULL;        const char *pszPath = CPLFormFilename(                CPLGetDirname( osFilename ),                GetFilePath(psComponent, &pszType),                "" );        const char *pszPolLayer = CPLGetXMLValue(psComponent, "polLayer", " ");        if ( !STARTS_WITH_CI(pszType, " ") ) {            if (STARTS_WITH_CI(pszType, "MAPPING_GRID") ) {                /* the mapping grid... save as a metadata item this path */                poDS->SetMetadataItem( "MAPPING_GRID", pszPath );            }            else if (STARTS_WITH_CI(pszType, "GEOREF")) {                /* save the path to the georef data for later use */                CPLFree( pszGeorefFile );                pszGeorefFile = CPLStrdup( pszPath );            }        }        else if( !STARTS_WITH_CI(pszPolLayer, " ") &&            STARTS_WITH_CI(psComponent->pszValue, "imageData") ) {            /* determine the polarization of this band */            ePolarization ePol;            if ( STARTS_WITH_CI(pszPolLayer, "HH") ) {                ePol = HH;            }            else if ( STARTS_WITH_CI(pszPolLayer, "HV") ) {                ePol = HV;            }            else if ( STARTS_WITH_CI(pszPolLayer, "VH") ) {                ePol = VH;            }            else {                ePol = VV;            }            GDALDataType eDataType = STARTS_WITH_CI(pszDataType, "COMPLEX") ?
开发者ID:Wedjaa,项目名称:node-gdal,代码行数:67,


示例18: CPLError

//.........这里部分代码省略.........	poDS->SetMetadataItem( "AZIMUTH_LOOKS", CPLGetXMLValue( psProductInfo,		"imageDataInfo.imageRaster.azimuthLooks", "unknown" ) );	poDS->SetMetadataItem( "RANGE_LOOKS", CPLGetXMLValue( psProductInfo,		"imageDataInfo.imageRaster.rangeLooks", "unknown" ) );    const char *pszProductVariant;    pszProductVariant = CPLGetXMLValue( psProductInfo,         "productVariantInfo.productVariant", "unknown" );    poDS->SetMetadataItem( "PRODUCT_VARIANT", pszProductVariant );    /* Determine what product variant this is */    if (EQUALN(pszProductVariant,"SSC",3))        poDS->nProduct = eSSC;    else if (EQUALN(pszProductVariant,"MGD",3))        poDS->nProduct = eMGD;    else if (EQUALN(pszProductVariant,"EEC",3))        poDS->nProduct = eEEC;    else if (EQUALN(pszProductVariant,"GEC",3))        poDS->nProduct = eGEC;    else        poDS->nProduct = eUnknown;	/* Start reading in the product components */	const char *pszPath;	char *pszGeorefFile = NULL;	CPLXMLNode *psComponent;	for (psComponent = psComponents->psChild; psComponent != NULL;		 psComponent = psComponent->psNext)	{		char *pszType;		pszPath = CPLFormFilename( 				CPLGetDirname( poOpenInfo->pszFilename ),				GetFilePath(psComponent, &pszType), 				"" );		const char *pszPolLayer = CPLGetXMLValue(psComponent, "polLayer", " ");		if ( !EQUALN(pszType," ",1) ) {			if (EQUALN(pszType, "MAPPING_GRID", 12) ) {				/* the mapping grid... save as a metadata item this path */				poDS->SetMetadataItem( "MAPPING_GRID", pszPath );				}			else if (EQUALN(pszType, "GEOREF", 6)) {				/* save the path to the georef data for later use */				pszGeorefFile = strdup( pszPath );			}			CPLFree(pszType);		}		else if( !EQUALN(pszPolLayer, " ", 1) && 			EQUALN(psComponent->pszValue, "imageData", 9) ) {			/* determine the polarization of this band */			ePolarization ePol;			if ( EQUALN(pszPolLayer, "HH", 2) ) {				ePol = HH;			}			else if ( EQUALN(pszPolLayer, "HV" , 2) ) {				ePol = HV;			}			else if ( EQUALN(pszPolLayer, "VH", 2) ) {				ePol = VH;			}			else {				ePol = VV;			}			GDALDataType eDataType = EQUALN(pszDataType, "COMPLEX", 7) ?
开发者ID:brunosimoes,项目名称:WorldWind,代码行数:67,


示例19: MirrorReadFile

static int DOKAN_CALLBACKMirrorReadFile(	LPCWSTR				FileName,	LPVOID				Buffer,	DWORD				BufferLength,	LPDWORD				ReadLength,	LONGLONG			Offset,	PDOKAN_FILE_INFO	DokanFileInfo){	WCHAR	filePath[MAX_PATH];	HANDLE	handle = (HANDLE)DokanFileInfo->Context;	ULONG	offset = (ULONG)Offset;	BOOL	opened = FALSE;	GetFilePath(filePath, MAX_PATH, FileName);	DbgPrint(L"ReadFile : %s/n", filePath);	if (!handle || handle == INVALID_HANDLE_VALUE) {		DbgPrint(L"/tinvalid handle, cleanuped?/n");		handle = CreateFile(			filePath,			GENERIC_READ,			FILE_SHARE_READ,			NULL,			OPEN_EXISTING,			0,			NULL);		if (handle == INVALID_HANDLE_VALUE) {			DbgPrint(L"/tCreateFile error : %d/n/n", GetLastError());			return -1;		}		opened = TRUE;	}	    LARGE_INTEGER distanceToMove;    distanceToMove.QuadPart = Offset;    if (!SetFilePointerEx(handle, distanceToMove, NULL, FILE_BEGIN)) {		DbgPrint(L"/tseek error, offset = %d/n/n", offset);		if (opened)			CloseHandle(handle);		return -1;	}			if (!ReadFile(handle, Buffer, BufferLength, ReadLength,NULL)) {		DbgPrint(L"/tread error = %u, buffer length = %d, read length = %d/n/n",			GetLastError(), BufferLength, *ReadLength);		if (opened)			CloseHandle(handle);		return -1;	} else {		DbgPrint(L"/tread %d, offset %d/n/n", *ReadLength, offset);	}	if (opened)		CloseHandle(handle);	return 0;}
开发者ID:jdstroy,项目名称:dokany,代码行数:61,


示例20: MirrorWriteFile

static int DOKAN_CALLBACKMirrorWriteFile(	LPCWSTR		FileName,	LPCVOID		Buffer,	DWORD		NumberOfBytesToWrite,	LPDWORD		NumberOfBytesWritten,	LONGLONG			Offset,	PDOKAN_FILE_INFO	DokanFileInfo){	WCHAR	filePath[MAX_PATH];	HANDLE	handle = (HANDLE)DokanFileInfo->Context;	ULONG	offset = (ULONG)Offset;	BOOL	opened = FALSE;	GetFilePath(filePath, MAX_PATH, FileName);	DbgPrint(L"WriteFile : %s, offset %I64d, length %d/n", filePath, Offset, NumberOfBytesToWrite);	// reopen the file	if (!handle || handle == INVALID_HANDLE_VALUE) {		DbgPrint(L"/tinvalid handle, cleanuped?/n");		handle = CreateFile(			filePath,			GENERIC_WRITE,			FILE_SHARE_WRITE,			NULL,			OPEN_EXISTING,			0,			NULL);		if (handle == INVALID_HANDLE_VALUE) {			DbgPrint(L"/tCreateFile error : %d/n/n", GetLastError());			return -1;		}		opened = TRUE;	}    LARGE_INTEGER distanceToMove;    distanceToMove.QuadPart = Offset;	if (DokanFileInfo->WriteToEndOfFile) {        LARGE_INTEGER z;        z.QuadPart = 0;		if (!SetFilePointerEx(handle, z, NULL, FILE_END)) {			DbgPrint(L"/tseek error, offset = EOF, error = %d/n", GetLastError());			return -1;		}    }    else if (!SetFilePointerEx(handle, distanceToMove, NULL, FILE_BEGIN)) {		DbgPrint(L"/tseek error, offset = %d, error = %d/n", offset, GetLastError());		return -1;	}			if (!WriteFile(handle, Buffer, NumberOfBytesToWrite, NumberOfBytesWritten, NULL)) {		DbgPrint(L"/twrite error = %u, buffer length = %d, write length = %d/n",			GetLastError(), NumberOfBytesToWrite, *NumberOfBytesWritten);		return -1;	} else {		DbgPrint(L"/twrite %d, offset %d/n/n", *NumberOfBytesWritten, offset);	}	// close the file when it is reopened	if (opened)		CloseHandle(handle);	return 0;}
开发者ID:jdstroy,项目名称:dokany,代码行数:68,


示例21: Material

//--------------------------------------------------------------------------------------void FBXScene::ProcessMaterials(FbxScene* pScene){	for( int i = 0; i < pScene->GetMaterialCount(); ++i )	{		Material* pMaterial = new Material(i);		FbxSurfaceMaterial* pFBXMaterial = pScene->GetMaterial(i);		FbxProperty diffuseTextureProperty = pFBXMaterial->FindProperty(FbxSurfaceMaterial::sDiffuse);		if( diffuseTextureProperty.IsValid() )		{			FbxFileTexture* pDiffuseTexture = diffuseTextureProperty.GetSrcObject<FbxFileTexture>(0);			if( pDiffuseTexture )			{				std::string strFileName = pDiffuseTexture->GetFileName();				if( strFileName.length() == 0 )					strFileName = pDiffuseTexture->GetRelativeFileName();				strFileName = GetFileFromPath(strFileName);				pMaterial->SetDiffuseTextureName(strFileName);			}		}				FbxProperty normalTextureProperty = pFBXMaterial->FindProperty(FbxSurfaceMaterial::sNormalMap);		if( normalTextureProperty.IsValid() )		{				FbxFileTexture* pNormalTexture = normalTextureProperty.GetSrcObject<FbxFileTexture>(0);				if( pNormalTexture )				{					std::string strFileName = pNormalTexture->GetFileName();					if( strFileName.length() == 0 )						strFileName = pNormalTexture->GetRelativeFileName();										strFileName = GetFileFromPath(strFileName);					pMaterial->SetNormalTextureName(strFileName);				}		}		FbxSurfaceLambert* pLambert = FbxCast<FbxSurfaceLambert>(pFBXMaterial);		FbxSurfacePhong* pPhong = FbxCast<FbxSurfacePhong>(pFBXMaterial); 		BTHFBX_VEC3 AmbientColor2;		BTHFBX_VEC3 EmissiveColor2;		BTHFBX_VEC3 DiffuseColor2;		BTHFBX_VEC3 SpecularColor2;		float fSpecularPower = 1.0f;		float fTransparency = 1.0f;		if( pLambert )		{			AmbientColor2 = GetMaterialColor2(pLambert->Ambient, pLambert->AmbientFactor);			EmissiveColor2 = GetMaterialColor2(pLambert->Emissive, pLambert->EmissiveFactor);			DiffuseColor2 = GetMaterialColor2(pLambert->Diffuse, pLambert->DiffuseFactor);			FbxPropertyT<FbxDouble> FBXTransparencyProperty = pLambert->TransparencyFactor;			if( FBXTransparencyProperty.IsValid() )				fTransparency = (float)FBXTransparencyProperty.Get();		}		if( pPhong )		{			SpecularColor2 = GetMaterialColor2(pPhong->Specular, pPhong->SpecularFactor);			FbxPropertyT<FbxDouble> FBXSpecularPowerProperty = pPhong->Shininess;			if( FBXSpecularPowerProperty.IsValid() )				fSpecularPower = (float)FBXSpecularPowerProperty.Get();		}		pMaterial->SetAmbientColor2(AmbientColor2);		pMaterial->SetEmissiveColor2(EmissiveColor2);		pMaterial->SetDiffuseColor2(DiffuseColor2);		pMaterial->SetSpecularColor2(SpecularColor2);		pMaterial->SetSpecularPower(fSpecularPower);		pMaterial->SetTransparency(fTransparency);		pMaterial->AddTexturePath( GetFilePath(this->mFilename) + "/" );		m_Materials.push_back(pMaterial);		m_FBXMaterials.push_back(pFBXMaterial);	}}
开发者ID:Malow,项目名称:NDYGFX,代码行数:92,


示例22: GetExePath

bool GetExePath(char *path){	TCHAR buf[MAX_PATH+1];	GetModuleFileName(NULL,buf,MAX_PATH);	return GetFilePath(buf,path,MAX_PATH);}
开发者ID:code4hunter,项目名称:oldpts,代码行数:6,


示例23: GetFilePath

	__time64_t CDirectoryManagerBase::GetLastUpdate(const std::string& fileName, const std::string& fileExt, bool bVerifyAllFiles)const	{		std::string filePath = GetFilePath(fileName, fileExt);		return GetFileStamp(fileName);	}
开发者ID:RNCan,项目名称:WeatherBasedSimulationFramework,代码行数:5,


示例24: GetFilePath

void CImagePack::SaveConfig( const tagHistoryInfo& _info ){	CString strConfig = GetFilePath()+"//Config.ini";	CString strTemp;	tagHistoryInfo tempInfo;	bool    bFindSame = false;	int     curUpdateIndex;	m_nSwitchOption = 0;	m_nSwitchOption|=((CButton*)GetDlgItem(IDC_SUBITEMUSE))->GetCheck()?SWITCH_OPTION_SAME:0;	m_nSwitchOption|=((CButton*)GetDlgItem(IDC_OPTIMIZE))->GetCheck()?SWITCH_OPTION_AUTO:0;	m_nSwitchOption|=((CButton*)GetDlgItem(IDC_2MI))->GetCheck()?SWITCH_OPTION_TOWMI:0;	m_nSwitchOption|=((CButton*)GetDlgItem(IDC_LUACORE))->GetCheck()?SWITCH_OPTION_LUA:0;	strTemp.Format("%d",m_nSwitchOption);	WritePrivateProfileString("Info","switchOption",strTemp.GetString(),strConfig);	for (int i=0;i<m_vecHistory.size();i++)	{		if(m_vecHistory[i].strFilePath == _info.strFilePath){			bFindSame = true;			m_vecHistory[i].nSpace = _info.nSpace;			m_vecHistory[i].nMaxHeight = _info.nMaxHeight;			m_vecHistory[i].nMaxWidth = _info.nMaxWidth;			m_vecHistory[i].strFileName = _info.strFileName;			tempInfo.nSpace = _info.nSpace;			tempInfo.nMaxHeight = _info.nMaxHeight;			tempInfo.nMaxWidth = _info.nMaxWidth;			tempInfo.strFileName = _info.strFileName;			tempInfo.strFilePath = _info.strFilePath;			tempInfo.nDataType = _info.nDataType;			curUpdateIndex = i+1;			break;		}	}		if(!bFindSame)	{		if(m_nLoopIndex>=m_nMaxSize)			m_nLoopIndex = 0;				if(m_nLoopIndex>=m_vecHistory.size())		{			tempInfo.nSpace = _info.nSpace;			tempInfo.nMaxHeight = _info.nMaxHeight;			tempInfo.nMaxWidth = _info.nMaxWidth;			tempInfo.strFileName = _info.strFileName;			tempInfo.strFilePath = _info.strFilePath;			tempInfo.nDataType = _info.nDataType;			m_vecHistory.push_back(tempInfo);			m_nLoopIndex++;			m_nSize = m_vecHistory.size();			insertComboBox(tempInfo.strFilePath);						curUpdateIndex = m_nLoopIndex;		}else		{			tagHistoryInfo &tempInfo = m_vecHistory[m_nLoopIndex];			tempInfo.nSpace = _info.nSpace;			tempInfo.nMaxHeight = _info.nMaxHeight;			tempInfo.nMaxWidth = _info.nMaxWidth;			tempInfo.strFileName = _info.strFileName;			tempInfo.strFilePath = _info.strFilePath;			tempInfo.nDataType = _info.nDataType;						insertComboBox(tempInfo.strFilePath);			m_nLoopIndex++;			curUpdateIndex = m_nLoopIndex;		}	}		CString strHistory;	strHistory.Format("History%d",curUpdateIndex);	strTemp.Format("%d",tempInfo.nSpace);	WritePrivateProfileString(strHistory,"space",strTemp.GetString(),strConfig); 	strTemp.Format("%d",tempInfo.nMaxHeight);	WritePrivateProfileString(strHistory,"maxWidth",strTemp.GetString(),strConfig);	strTemp.Format("%d",tempInfo.nMaxWidth);	WritePrivateProfileString(strHistory,"maxHeight",strTemp.GetString(),strConfig);	strTemp.Format("%d",tempInfo.nDataType);	WritePrivateProfileString(strHistory,"dataType",strTemp.GetString(),strConfig);	WritePrivateProfileString(strHistory,"fileName",tempInfo.strFileName.GetString(),strConfig);	WritePrivateProfileString(strHistory,"filePath",tempInfo.strFilePath.GetString(),strConfig);	strTemp.Format("%d",m_nSize);	WritePrivateProfileString("Info","Size",strTemp.GetString(),strConfig); 	strTemp.Format("%d",m_nMaxSize);	WritePrivateProfileString("Info","MaxSize",strTemp.GetString(),strConfig);	strTemp.Format("%d",m_nCurIndex);	WritePrivateProfileString("Info","CurIndex",strTemp.GetString(),strConfig);	strTemp.Format("%d",m_nLoopIndex);	WritePrivateProfileString("Info","LoopIndex",strTemp.GetString(),strConfig);		}
开发者ID:lx3389,项目名称:BindImage,代码行数:97,


示例25: DoRecovery

/** * @brief recover the database and check the tuples */void DoRecovery(std::string file_name) {  std::chrono::time_point<std::chrono::system_clock> start, end;  std::chrono::duration<double, std::milli> elapsed_milliseconds;  auto file_path = GetFilePath(state.log_file_dir, file_name);  std::ifstream log_file(file_path);  // Reset the log file if exists  log_file.close();  CreateDatabaseAndTable(LOGGING_TESTS_DATABASE_OID, LOGGING_TESTS_TABLE_OID);  // start a thread for logging  auto& log_manager = logging::LogManager::GetInstance();  if (log_manager.ActiveFrontendLoggerCount() > 0) {    LOG_ERROR("another logging thread is running now");    return;  }  //===--------------------------------------------------------------------===//  // RECOVERY  //===--------------------------------------------------------------------===//  start = std::chrono::system_clock::now();  // set log file and logging type  log_manager.SetLogFileName(file_path);  // start off the frontend logger of appropriate type in STANDBY mode  std::thread thread(&logging::LogManager::StartStandbyMode, &log_manager);  // wait for the frontend logger to enter STANDBY mode  log_manager.WaitForMode(LOGGING_STATUS_TYPE_STANDBY, true);  // STANDBY -> RECOVERY mode  log_manager.StartRecoveryMode();  // Wait for the frontend logger to enter LOGGING mode after recovery  log_manager.WaitForMode(LOGGING_STATUS_TYPE_LOGGING, true);  end = std::chrono::system_clock::now();  elapsed_milliseconds = end - start;  // Recovery time  if (state.experiment_type == EXPERIMENT_TYPE_RECOVERY)    WriteOutput(elapsed_milliseconds.count());  // Check the tuple count if needed  if (state.check_tuple_count) {    oid_t total_expected = 0;    CheckTupleCount(LOGGING_TESTS_DATABASE_OID, LOGGING_TESTS_TABLE_OID,                    total_expected);  }  // Check the next oid  // CheckNextOid();  if (log_manager.EndLogging()) {    thread.join();  } else {    LOG_ERROR("Failed to terminate logging thread");  }  DropDatabaseAndTable(LOGGING_TESTS_DATABASE_OID, LOGGING_TESTS_TABLE_OID);}
开发者ID:YangMann,项目名称:peloton,代码行数:68,


示例26: main

/** *  Hauptfunktion von Siedler II.5 Return to the Roots * *  @param[in] argc Anzahl übergebener Argumente *  @param[in] argv Array der übergebenen Argumente * *  @return Exit Status, 0 bei Erfolg, > 0 bei Fehler * *  @author FloSoft *  @author OLiver */int main(int argc, char* argv[]){#if defined _WIN32 && defined _DEBUG && defined _MSC_VER && !defined NOHWETRANS    _set_se_translator(ExceptionHandler);#endif // _WIN32 && _DEBUG && !NOHWETRANS#if defined _WIN32 && defined _DEBUG && defined _MSC_VER && !defined NOCRTDBG    // Enable Memory-Leak-Detection    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_LEAK_CHECK_DF /*| _CRTDBG_CHECK_CRT_DF*/);#endif // _WIN32 && _DEBUG && !NOCRTDBG    // Signal-Handler setzen#ifdef _WIN32    SetConsoleCtrlHandler(HandlerRoutine, TRUE);    // set console window icon    SendMessage(GetConsoleWindow(), WM_SETICON, (WPARAM)TRUE, (LPARAM)LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_SYMBOL)));    // Set UTF-8 console charset    SetConsoleOutputCP(CP_UTF8);#ifndef _MSC_VER    signal(SIGSEGV, WinExceptionHandler);#else    SetUnhandledExceptionFilter(WinExceptionHandler);#endif    //AddVectoredExceptionHandler(1, WinExceptionHandler);#else    struct sigaction sa;    sa.sa_handler = HandlerRoutine;    sa.sa_flags = 0; //SA_RESTART would not allow to interrupt connect call;    sigemptyset(&sa.sa_mask);    sigaction(SIGINT, &sa, NULL);    sigaction(SIGPIPE, &sa, NULL);    sigaction(SIGALRM, &sa, NULL);    signal(SIGSEGV, LinExceptionHandler);#endif // _WIN32    // diverse dirs anlegen    const unsigned int dir_count = 7;    unsigned int dirs[dir_count] = { 94, 47, 48, 51, 85, 98, 99 }; // settingsdir muss zuerst angelegt werden (94)#ifdef _WIN32    if(IsDir(GetFilePath("~/Siedler II.5 RttR")))        MoveFileA(GetFilePath("~/Siedler II.5 RttR").c_str(), GetFilePath(FILE_PATHS[94]).c_str());#endif#ifdef __APPLE__    if(IsDir(GetFilePath("~/.s25rttr")))        rename(GetFilePath("~/.s25rttr").c_str(), GetFilePath(FILE_PATHS[94]).c_str());#endif    for(unsigned int i = 0; i < dir_count; ++i)    {        std::string dir = GetFilePath(FILE_PATHS[dirs[i]]);        if(mkdir_p(dir) < 0)        {            error("Verzeichnis %s konnte nicht erstellt werden: ", dir.c_str());            error("Das Spiel konnte nicht gestartet werden");            return 1;        }    }    libsiedler2::setTextureFormat(libsiedler2::FORMAT_RGBA);    libsiedler2::setAllocator(glAllocator);    // Zufallsgenerator initialisieren (Achtung: nur für Animationens-Offsets interessant, für alles andere (spielentscheidende) wird unser Generator verwendet)    srand(static_cast<unsigned int>(std::time(NULL)));    // Exit-Handler initialisieren    atexit(&ExitHandler);    // Socketzeug initialisieren    if(!Socket::Initialize())    {        error("Konnte Sockets nicht initialisieren!");        return 1;    }    // Spiel starten    if(!GAMEMANAGER.Start())    {        error("Das Spiel konnte nicht gestartet werden");        return 1;    }//.........这里部分代码省略.........
开发者ID:lweberk,项目名称:s25client,代码行数:101,


万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。