Line-up interfaces to use size_t for GetCount()s (and count related api).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38033 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2006-03-12 15:14:12 +00:00
parent 5d0d3e6d72
commit 0360340068
3 changed files with 11 additions and 12 deletions

View File

@@ -119,7 +119,7 @@ public:
const wxString& GetDescription() const { return m_desc; } const wxString& GetDescription() const { return m_desc; }
// get the array of all extensions // get the array of all extensions
const wxArrayString& GetExtensions() const { return m_exts; } const wxArrayString& GetExtensions() const { return m_exts; }
int GetExtensionsCount() const {return m_exts.GetCount(); } size_t GetExtensionsCount() const {return m_exts.GetCount(); }
// get the icon info // get the icon info
const wxString& GetIconFile() const { return m_iconFile; } const wxString& GetIconFile() const { return m_iconFile; }
int GetIconIndex() const { return m_iconIndex; } int GetIconIndex() const { return m_iconIndex; }

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: mac/mimetype.cpp // Name: src/mac/carbon/mimetype.cpp
// Purpose: Mac Carbon implementation for wx MIME-related classes // Purpose: Mac Carbon implementation for wx MIME-related classes
// Author: Ryan Norton // Author: Ryan Norton
// Modified by: // Modified by:
@@ -30,6 +30,8 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#if wxUSE_MIMETYPE
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/string.h" #include "wx/string.h"
@@ -38,9 +40,6 @@
#endif #endif
#endif #endif
#if wxUSE_MIMETYPE
#include "wx/log.h" #include "wx/log.h"
#include "wx/file.h" #include "wx/file.h"
#include "wx/intl.h" #include "wx/intl.h"
@@ -415,7 +414,7 @@ wxString wxFileTypeImpl::GetCommand(const wxString& verb) const
m_lIndex, &entry); m_lIndex, &entry);
wxString sCurrentExtension = wxMacMakeStringFromPascal(entry.extension); wxString sCurrentExtension = wxMacMakeStringFromPascal(entry.extension);
sCurrentExtension = sCurrentExtension.Right(sCurrentExtension.Length()-1 ); sCurrentExtension = sCurrentExtension.Right(sCurrentExtension.length()-1 );
//type, creator, ext, roles, outapp (FSRef), outappurl //type, creator, ext, roles, outapp (FSRef), outappurl
CFURLRef cfurlAppPath; CFURLRef cfurlAppPath;
@@ -547,7 +546,7 @@ bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
//entry has period in it //entry has period in it
wxString sCurrentExtension = wxMacMakeStringFromPascal( entry.extension ); wxString sCurrentExtension = wxMacMakeStringFromPascal( entry.extension );
extensions.Add( sCurrentExtension.Right( sCurrentExtension.Length() - 1 ) ); extensions.Add( sCurrentExtension.Right( sCurrentExtension.length() - 1 ) );
return true; return true;
} }
@@ -717,7 +716,7 @@ wxFileType* wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& e)
if (status == noErr) if (status == noErr)
{ {
wxString sCurrentExtension = wxMacMakeStringFromPascal(entry.extension); wxString sCurrentExtension = wxMacMakeStringFromPascal(entry.extension);
if ( sCurrentExtension.Right(sCurrentExtension.Length() - 1) == e ) // entry has period in it if ( sCurrentExtension.Right(sCurrentExtension.length() - 1) == e ) // entry has period in it
{ {
wxFileType* pFileType = new wxFileType(); wxFileType* pFileType = new wxFileType();
pFileType->m_impl->Init((wxMimeTypesManagerImpl*)this, pos); pFileType->m_impl->Init((wxMimeTypesManagerImpl*)this, pos);
@@ -1592,7 +1591,7 @@ wxFileType* wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
//'*' for unrestricted //'*' for unrestricted
if (ftInfo.GetExtensionsCount() != 0) if (ftInfo.GetExtensionsCount() != 0)
{ {
for (size_t iExtension = 0; iExtension < (size_t)ftInfo.GetExtensionsCount(); ++iExtension) for (size_t iExtension = 0; iExtension < ftInfo.GetExtensionsCount(); ++iExtension)
{ {
cfaExtensions.Add( wxCFString( asExtensions[iExtension] ) ); cfaExtensions.Add( wxCFString( asExtensions[iExtension] ) );
} }
@@ -1750,7 +1749,7 @@ wxFileType* wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
wxMacStringToPascal(ftInfo.GetDescription(), psDescription); wxMacStringToPascal(ftInfo.GetDescription(), psDescription);
Str255 psPostCreatorName; Str255 psPostCreatorName;
wxMacStringToPascal(wxT(""), psPostCreatorName); wxMacStringToPascal(wxEmptyString, psPostCreatorName);
//add the entry to the database //add the entry to the database
ICMapEntry entry; ICMapEntry entry;

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: msw/mimetype.cpp // Name: src/msw/mimetype.cpp
// Purpose: classes and functions to manage MIME types // Purpose: classes and functions to manage MIME types
// Author: Vadim Zeitlin // Author: Vadim Zeitlin
// Modified by: // Modified by:
@@ -509,7 +509,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
_T("Associate() needs extension") ); _T("Associate() needs extension") );
bool ok; bool ok;
int iExtCount = 0 ; size_t iExtCount = 0;
wxString filetype; wxString filetype;
wxString extWithDot; wxString extWithDot;