当前位置: 首页>>代码示例>>C++>>正文


C++ wxFileName::IsOk方法代码示例

本文整理汇总了C++中wxFileName::IsOk方法的典型用法代码示例。如果您正苦于以下问题:C++ wxFileName::IsOk方法的具体用法?C++ wxFileName::IsOk怎么用?C++ wxFileName::IsOk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wxFileName的用法示例。


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

示例1: OpenDatabase

void TagsDatabase::OpenDatabase(const wxFileName& fileName)
{
	if(m_fileName == fileName)
		return;

	// Did we get a file name to use?
	if(!fileName.IsOk() && !m_fileName.IsOk())
		return;

	// We did not get any file name to use BUT we
	// do have an open database, so we will use it
	if(!fileName.IsOk())
		return;

	if(!m_fileName.IsOk())
	{
		// First time we open the db
		m_db->Open(fileName.GetFullPath());
		CreateSchema();
		m_fileName = fileName;
	}
	else
	{
		// We have both fileName & m_fileName and they 
		// are different, Close previous db
		m_db->Close();
		m_db->Open(fileName.GetFullPath());
		CreateSchema();
		m_fileName = fileName;
	}
}
开发者ID:BackupTheBerlios,项目名称:codelite-svn,代码行数:31,代码来源:tags_database.cpp

示例2: FindEntry

const wxExVCSEntry wxExVCS::FindEntry(const wxFileName& filename)
{
  const int vcs = wxConfigBase::Get()->ReadLong("VCS", VCS_AUTO);

  if (vcs == VCS_AUTO)
  {
    if (filename.IsOk())
    {
      for (
        auto it = m_Entries.begin();
        it != m_Entries.end();
        ++it)
      {
        const bool toplevel = it->AdminDirIsTopLevel();
        const wxString admin_dir = it->GetAdminDir();

        if (toplevel && IsAdminDirTopLevel(admin_dir, filename))
        {
          return *it;
        }
        else if (IsAdminDir(admin_dir, filename))
        {
          return *it;
        }
      }
    }
  }
  else if (vcs >= VCS_START && vcs < m_Entries.size())
  {
    return m_Entries[vcs];
  }
  
  return wxExVCSEntry();
}
开发者ID:hfvw,项目名称:wxExtension,代码行数:34,代码来源:vcs.cpp

示例3: WinPathToCygwin

wxString eDocumentPath::WinPathToCygwin(const wxFileName& path) { 
	wxASSERT(path.IsOk() && path.IsAbsolute());

#ifndef __WXMSW__
    return path.GetFullPath();
#else
    wxString fullpath = path.GetFullPath();

	// Check if we have a foward-slash unc path; cygwin can handle these directly.
	if (fullpath.StartsWith(wxT("//"))) {
		return fullpath;
	}
	
	// Check if we have a backslash unc path; convert to forward slash and pass on.
	if (fullpath.StartsWith(wxT("\\\\"))) {
		fullpath.Replace(wxT("\\"), wxT("/"));
		return fullpath;
	}

	// Convert C:\... to /cygdrive/c/...
	wxString unixPath = eDocumentPath::s_cygdrivePrefix + path.GetVolume().Lower();

	// Convert slashs in path segments
	const wxArrayString& dirs = path.GetDirs();
	for (unsigned int i = 0; i < dirs.GetCount(); ++i) {
		unixPath += wxT('/') + dirs[i];
	}

	// Add the filename, if there is one
	if (path.HasName()) unixPath += wxT('/') + path.GetFullName();

	return unixPath;
#endif
}
开发者ID:joeri,项目名称:e,代码行数:34,代码来源:eDocumentPath.cpp

示例4: HasFSOExecutables

bool FSOExecutable::HasFSOExecutables(const wxFileName& path) {
	wxCHECK_MSG(path.IsOk(), false,
		wxString::Format(_T("provided path %s to HasFSOExecutables is invalid"),
			path.GetFullPath().c_str()));
	
	return !FSOExecutable::GetBinariesFromRootFolder(path, true).IsEmpty(); 
}
开发者ID:fjelliott,项目名称:wxlauncher,代码行数:7,代码来源:FSOExecutable.cpp

示例5: GetUserDir

/*
        This routine is platform-independent.

        MMEX is a portable application which means ability to to run
        without installation, for example, from USB flash drive.

        If mmex finds mmexini.db3 in its folder, it assumes portable
        mode and GetUserDir() in such case points to that folder.

        FIXME: security issue - temp files will be created on host filesystem.
*/
const wxFileName mmex::GetUserDir(bool create)
{
    static wxFileName fname;

    if (!fname.IsOk())
    {
        fname = getSettingsPathPortable();

        bool portable_file_ok = fname.IsFileWritable() && fname.IsFileReadable();

        if (!portable_file_ok)
        {
            fname.AssignDir(wxStandardPaths::Get().GetUserDataDir());

            if (create && !fname.DirExists())
            {
                portable_file_ok = fname.Mkdir(0700, wxPATH_MKDIR_FULL); // 0700 - octal, "111 000 000"
                wxASSERT(portable_file_ok);
            }
        }

        fname.SetFullName(wxGetEmptyString());
    }

    return fname;
}
开发者ID:omalleypat,项目名称:moneymanagerex,代码行数:37,代码来源:paths.cpp

示例6: IsAdminDirTopLevel

bool wxExVCS::IsAdminDirTopLevel(
  const wxString& admin_dir, 
  const wxFileName& fn)
{
  if (!fn.IsOk() || admin_dir.empty())
  {
    return false;
  }
  
  // The .git dir only exists in the root, so check all components.
  wxFileName root(fn);

  while (root.DirExists() && root.GetDirCount() > 0)
  {
    wxFileName path(root);
    path.AppendDir(admin_dir);

    if (path.DirExists() && !path.FileExists())
    {
      return true;
    }

    root.RemoveLastDir();
  }

  return false;
}
开发者ID:hfvw,项目名称:wxExtension,代码行数:27,代码来源:vcs.cpp

示例7: NormalizePath

bool NormalizePath(wxFileName& f,const wxString& base)
{
    bool result = true;
//    if (!f.IsAbsolute())
    {
        f.Normalize(wxPATH_NORM_ALL & ~wxPATH_NORM_CASE, base);
        result = f.IsOk();
    }
    return result;
}
开发者ID:stahta01,项目名称:codeblocks_https_metadata,代码行数:10,代码来源:globals.cpp

示例8: SelectTagsByFile

wxSQLite3ResultSet TagsDatabase::SelectTagsByFile(const wxString& file, const wxFileName& path)
{
	// Incase empty file path is provided, use the current file name
	wxFileName databaseFileName(path);
	path.IsOk() == false ? databaseFileName = m_fileName : databaseFileName = path;
	OpenDatabase(databaseFileName);

	wxString query;
	query = wxString::Format(_T("select * from tags where file='%s';"), file.GetData());
	return m_db->ExecuteQuery(query.GetData());
}
开发者ID:BackupTheBerlios,项目名称:codelite-svn,代码行数:11,代码来源:tags_database.cpp

示例9: GetSharedDir

/*
    $(prefix)/share/mmex.
    Default install prefix is /usr (often /usr/local).
*/
const wxFileName mmex::GetSharedDir()
{
    static wxFileName fname;

    if (!fname.IsOk()) 
    {
        SetInstallPrefix();
        fname = wxFileName::DirName(wxStandardPaths::Get().GetDataDir());
    }

    return fname;
}
开发者ID:omalleypat,项目名称:moneymanagerex,代码行数:16,代码来源:platfdep.cpp

示例10: GetResourceDir

/*
    $(prefix)/share/mmex/res
*/
const wxFileName mmex::GetResourceDir()
{
    static wxFileName fname;

    if (!fname.IsOk()) 
    {
        fname = GetSharedDir();
        fname.AppendDir("res");
    }

    return fname;
}
开发者ID:omalleypat,项目名称:moneymanagerex,代码行数:15,代码来源:platfdep.cpp

示例11: GetDocDir

const wxFileName mmex::GetDocDir()
{
    static wxFileName fname;

    if (!fname.IsOk())
    {
        fname = GetSharedDir();
        fname.AppendDir("doc");
    }

    return fname;
}
开发者ID:unrealps,项目名称:moneymanagerex,代码行数:12,代码来源:platfdep.cpp

示例12: GetLogDir

const wxFileName mmex::GetLogDir(bool create)
{
    static wxFileName fname;

    if (!fname.IsOk())
    {
        fname = GetUserDir(create);
        //FIXME: file not found ERROR
        //fname.AppendDir("logs");
    }

    return fname;
}
开发者ID:omalleypat,项目名称:moneymanagerex,代码行数:13,代码来源:paths.cpp

示例13: wxFileName

CMP_LIBRARY::CMP_LIBRARY( int aType, const wxFileName& aFileName )
{
    type = aType;
    isModified = false;
    timeStamp = 0;
    isCache = false;
    timeStamp = wxDateTime::Now();

    if( aFileName.IsOk() )
        fileName = aFileName;
    else
        fileName = wxFileName( wxT( "unnamed.lib" ) );
}
开发者ID:peabody124,项目名称:kicad,代码行数:13,代码来源:class_library.cpp

示例14: ReadImage

bool ArtDrvSim::ReadImage(const wxFileName &simName)
{
   FILE* ifi;
   if (!simName.IsOk()) return false;

   if ( (ifi = ::fopen(simName.GetFullPath().fn_str(), "rb"))==NULL) {
      // open fails...
      return false;
   }
   size_t fLength = m_camProps.nPixelsX*m_camProps.nPixelsY * 2;
   size_t fRead = ::fread(m_imageData, 1, fLength, ifi);
   ::fclose(ifi);
   return (fLength==fRead);
}
开发者ID:MarekTP,项目名称:wxAstroCapture,代码行数:14,代码来源:ArtDrvSim.cpp

示例15: IsAdminDir

bool wxExVCS::IsAdminDir(
  const wxString& admin_dir, 
  const wxFileName& fn)
{
  if (admin_dir.empty() || !fn.IsOk())
  {
    return false;
  }
  
  // these cannot be combined, as AppendDir is a void (2.9.1).
  wxFileName path(fn);
  path.AppendDir(admin_dir);
  return path.DirExists() && !path.FileExists();
}
开发者ID:hfvw,项目名称:wxExtension,代码行数:14,代码来源:vcs.cpp


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