Example #1
0
wxString wxFileData::GetHint() const
{
    wxString s = m_filePath;
    s += wxT("  ");

    if (IsDir())
        s += _("<DIR>");
    else if (IsLink())
        s += _("<LINK>");
    else if (IsDrive())
        s += _("<DRIVE>");
    else // plain file
        s += wxString::Format(wxPLURAL("%ld byte", "%ld bytes", m_size),
                              wxLongLong(m_size).ToString().c_str());

    s += wxT(' ');

    if ( !IsDrive() )
    {
        s << GetModificationTime()
          << wxT("  ")
          << m_permissions;
    }

    return s;
}
Example #2
0
wxString wxFileData::GetEntry( fileListFieldType num ) const
{
    wxString s;
    switch ( num )
    {
        case FileList_Name:
            s = m_fileName;
            break;

        case FileList_Size:
            if (!IsDir() && !IsLink() && !IsDrive())
                s = wxLongLong(m_size).ToString();
            break;

        case FileList_Type:
            s = GetFileType();
            break;

        case FileList_Time:
            if (!IsDrive())
                s = GetModificationTime();
            break;

#if defined(__UNIX__) || defined(__WIN32__)
        case FileList_Perm:
            s = m_permissions;
            break;
#endif // defined(__UNIX__) || defined(__WIN32__)

        default:
            wxFAIL_MSG( wxT("unexpected field in wxFileData::GetEntry()") );
    }

    return s;
}
wxString FileData::GetHint() const
{
   wxString s = m_filePath;
   s += wxT("  ");
   
   if (IsDir())
      s += _("<DIR>");
   else if (IsLink())
      s += _("<LINK>");
   else if (IsDrive())
      s += _("<DRIVE>");
   else // plain file
      s += wxString::Format( _("%ld bytes"), m_size );
   
   s += wxT(' ');
   
   if ( !IsDrive() )
   {
      s << GetModificationTime()
      << wxT("  ")
      << m_permissions;
   }
   
   return s;
};