本文整理汇总了C++中wxFileName::GetModificationTime方法的典型用法代码示例。如果您正苦于以下问题:C++ wxFileName::GetModificationTime方法的具体用法?C++ wxFileName::GetModificationTime怎么用?C++ wxFileName::GetModificationTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxFileName
的用法示例。
在下文中一共展示了wxFileName::GetModificationTime方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetLibModificationTime
wxDateTime GPCB_FPL_CACHE::GetLibModificationTime() const
{
if( !m_lib_path.DirExists() )
return wxDateTime::Now();
return m_lib_path.GetModificationTime();
}
示例2: eDocumentPath_shouldUpdateCygwin
//
// Returns true if this Cygwin installation should be updated (or installed for the first time.)
// Returns false if we are up-to-date.
//
bool eDocumentPath_shouldUpdateCygwin(wxDateTime &stampTime, const wxFileName &supportFile){
// E's support folder comes with a network installer for Cygwin.
// Newer versions of E may come with newer Cygwin versions.
// If the user already has Cygwin installed, we still check the
// bundled installer to see if it is newer; if so, then we need to
// re-install Cygwin at the newer version.
if (!stampTime.IsValid())
return true; // First time, so we need to update.
wxDateTime updateTime = supportFile.GetModificationTime();
// Windows doesn't store milliseconds; we clear out this part of the time.
updateTime.SetMillisecond(0);
updateTime.SetSecond(0);
stampTime.SetMillisecond(0);
stampTime.SetSecond(0);
// If the times are the same, no update needed.
if (updateTime == stampTime)
return false;
// ...else the dates differ and we need to update.
wxLogDebug(wxT("InitCygwin: Diff dates"));
wxLogDebug(wxT(" e-postinstall: %s"), updateTime.FormatTime());
wxLogDebug(wxT(" last-e-update: %s"), stampTime.FormatTime());
return true;
}
示例3: IsModified
bool GPCB_FPL_CACHE_ITEM::IsModified() const
{
if( !m_file_name.FileExists() )
return false;
return m_file_name.GetModificationTime() != m_mod_time;
}
示例4: wxExCompareFile
bool wxExCompareFile(const wxFileName& file1, const wxFileName& file2)
{
if (wxConfigBase::Get()->Read(_("Comparator")).empty())
{
return false;
}
const wxString arguments =
(file1.GetModificationTime() < file2.GetModificationTime()) ?
"\"" + file1.GetFullPath() + "\" \"" + file2.GetFullPath() + "\"":
"\"" + file2.GetFullPath() + "\" \"" + file1.GetFullPath() + "\"";
if (wxExecute(wxConfigBase::Get()->Read(_("Comparator")) + " " + arguments) == 0)
{
return false;
}
wxLogStatus(_("Compared") + ": " + arguments);
return true;
}
示例5: wxExPrintHeader
const wxString wxExPrintHeader(const wxFileName& filename)
{
if (filename.FileExists())
{
return
wxExGetEndOfText(
filename.GetFullPath() + " " +
filename.GetModificationTime().Format(),
80);
}
else
{
return _("Printed") + ": " + wxDateTime::Now().Format();
}
}
示例6: get_last_cygwin_update
//
// Gets the cygwin last update time, migrating state form previous e versions if needed.
//
wxDateTime get_last_cygwin_update() {
wxDateTime stampTime;
wxLongLong dateVal;
eSettings& settings = eGetSettings();
if (settings.GetSettingLong(wxT("cyg_date"), dateVal)) stampTime = wxDateTime(dateVal);
// In older versions it could be saved as filestamp
if (!stampTime.IsValid()) {
const wxFileName timestamp(eDocumentPath::CygwinPath() + wxT("\\etc\\setup\\last-e-update"));
if (timestamp.FileExists()) {
stampTime = timestamp.GetModificationTime();
// Save in new location
settings.SetSettingLong(wxT("cyg_date"), stampTime.GetValue());
}
}
return stampTime;
}
示例7: wxExLogStatus
void wxExLogStatus(const wxFileName& fn, long flags)
{
if (!fn.IsOk())
{
return;
}
wxString text = (flags & STAT_FULLPATH ?
fn.GetFullPath():
fn.GetFullName());
if (fn.FileExists())
{
const wxString what = (flags & STAT_SYNC ?
_("Synchronized"):
_("Modified"));
text += " " + what + " " + fn.GetModificationTime().Format();
}
wxLogStatus(text);
}
示例8: operator
bool operator()(const wxFileName& one, const wxFileName& two) const
{
return one.GetModificationTime().GetTicks() > two.GetModificationTime().GetTicks();
}
示例9: wxExFindOtherFileName
bool wxExFindOtherFileName(
const wxFileName& filename,
wxFileName* lastfile)
{
/* Add the base version if present. E.g.
fullpath: F:\CCIS\v990308\com\atis\atis-ctrl\atis-ctrl.cc
base: F:\CCIS\
append: \com\atis\atis-ctrl\atis-ctrl.cc
*/
const wxString fullpath = filename.GetFullPath();
const wxRegEx reg("[/|\\][a-z-]*[0-9]+\\.?[0-9]*\\.?[0-9]*\\.?[0-9]*");
if (!reg.Matches(fullpath.Lower()))
{
wxLogStatus(_("No version information found"));
return false;
}
size_t start, len;
if (!reg.GetMatch(&start, &len))
{
wxFAIL;
return false;
}
wxString base = fullpath.substr(0, start);
if (!wxEndsWithPathSeparator(base))
{
base += wxFileName::GetPathSeparator();
}
wxDir dir(base);
if (!dir.IsOpened())
{
wxFAIL;
return false;
}
wxString filename_string;
bool cont = dir.GetFirst(&filename_string, wxEmptyString, wxDIR_DIRS); // only get dirs
wxDateTime lastmodtime((time_t)0);
const wxString append = fullpath.substr(start + len);
bool found = false;
// Readme: Maybe use a thread for this.
while (cont)
{
wxFileName fn(base + filename_string + append);
if (fn.FileExists() &&
fn.GetPath().CmpNoCase(filename.GetPath()) != 0 &&
fn.GetModificationTime() != filename.GetModificationTime())
{
found = true;
if (fn.GetModificationTime() > lastmodtime)
{
lastmodtime = fn.GetModificationTime();
*lastfile = fn;
}
}
cont = dir.GetNext(&filename_string);
if (wxTheApp != NULL)
{
wxTheApp->Yield();
}
}
if (!found)
{
wxLogStatus(_("No files found"));
}
return found;
}
示例10: UpdateModificationTime
void UpdateModificationTime() { m_mod_time = m_file_name.GetModificationTime(); }