wxPackage Class Reference

#include <package.h>

Inheritance diagram for wxPackage:

wxPackageInfo wxPackageId List of all members.

Public Member Functions

 wxPackage ()
 wxPackage (const wxPackageInfo &info, wxPackageStatus stat=wxPS_INVALID)
virtual ~wxPackage ()
wxPackageoperator= (const wxPackageInfo &info)
wxPackageStatus GetStatus () const
wxString GetStatusStr () const
wxString GetDownloadPath () const
wxString GetDecompressionPath () const
wxString GetInstallationPath () const
wxCompilerSettingsGetCompilerSettings ()
wxCompilerSettings GetCompilerSettings () const
wxString GetRelativeWXPPath () const
wxString GetAbsWXPPath () const
wxString GetWXPFileName () const
wxULongLong GetDecompressedSize () const
void SetCompilerSettings (const wxCompilerSettings &sett)
void SetDecompressionPath (const wxString &path)
bool IsOk () const
wxWidgetsBuildArray GetSupportedWxBuilds (bool docompilercheck=true) const
 Returns the wxWidgets builds supported by this package.
bool GetRecursiveDependencies (wxPackageDependencyArray *ret, const wxPackageArray &arr, wxPackageDependencyType type, wxPackageDependencyArray *notfound=NULL) const
wxArrayString GetIncludedFiles (wxULongLong *totalsize=NULL) const
bool LoadCompressedPackage (const wxString &wxzpath)
bool Decompress (const wxString &path, wxProgressHandler *handler=NULL)
bool Compress (const wxString &wxz=wxEmptyString, wxProgressHandler *handler=NULL)
bool UploadWithFTP (const wxString &user=wxEmptyString, const wxString &password=wxEmptyString, const wxString &server=wxEmptyString, const wxString &path=wxEmptyString)
void SetRemoteStatus (const wxString &downloadpath=wxEmptyString)
void SetDownloadedStatus (const wxString &downloadpath)
 Sets the package as downloaded in the given path.
void SetDecompressedStatus (const wxString &decompressionpath)
 Sets the package as decompressed in the given path.
void SetBuiltStatus ()
 Sets the package as built.
void SetInstalledStatus (const wxString &installpath)
 Sets the package as installed in the given path.
void SetRelativeWXPPath (const wxString &path)
void UpdatePackageInfo ()
bool LoadStatusInfo (wxConfigBase *cfg, const wxString &path)
bool SaveStatusInfo (wxConfigBase *cfg, const wxString &path) const
bool UpdateCompressedSize ()
bool UpdateMD5 ()

Static Public Member Functions

static bool LoadGlobals (wxConfigBase *, const wxString &path)
 Loads the paths of the local repositories from given wxConfig object & path.
static void SaveGlobals (wxConfigBase *, const wxString &path)
 Saves the local repositories paths to given wxConfig.

Static Public Attributes

static wxArrayString s_arrLocalRepo
 The paths to the local repositories.
static wxArrayString s_arrRemoteRepo
 The paths to the remote repositories.

Protected Member Functions

virtual wxPackageCommand GetCmd (const wxPackageCommand &cmd, wxPackageBuildSystemStage stage, long flags, const wxPackageCondition &cond) const
bool DoGetRecursiveDependencies (wxPackageDependencyArray *ret, const wxPackageArray &arr, wxPackageDependencyType type, wxPackageDependencyArray *notfound, wxPackageIdArray *alreadyprocessed) const
wxArchiveInputStream * GetInputStream (const wxString &wxzpath) const
 Returns an input stream for the WXZ placed in 'wxzpath'.
virtual void DoUpdateSubstitutionHashMap (wxPackageSubstituteInfoContext ctx)

Protected Attributes

wxPackageStatus m_status
 The current status of this package.
wxCompilerSettings m_compiler
 The compiler currently in use for this package.
wxString m_strDownloadPath
wxString m_strDecompressionPath
wxString m_strWXPPath
wxString m_strInstallationPath

Friends

class wxPackageDependency

Detailed Description

A wxWidgets package. This class is separed from wxPackageInfo just to make it clear which functions operates on the package info and which do more complicated tasks.

It does not support directly operations like 'build', 'install' or 'uninstall' as such high-level functions would be useful for a good GUI which needs much deeper control over these operations.

Definition at line 102 of file package.h.


Member Function Documentation

wxString wxPackage::GetWXPFileName (  )  const [inline]

Returns only the filename (and extension) of the WXP of this package. Valid only when status >= wxPS_DECOMPRESSED

Definition at line 167 of file package.h.

References m_strWXPPath.

wxULongLong wxPackage::GetDecompressedSize (  )  const

Returns the size of the package once it is decompressed. This involves reading the while package's WXZ but not decompressing it.

Definition at line 382 of file package.cpp.

References GetDownloadPath(), GetInputStream(), and m_status.

Referenced by Decompress(), and wxPackageDecompressDlg::SetPackage().

bool wxPackage::GetRecursiveDependencies ( wxPackageDependencyArray ret,
const wxPackageArray arr,
wxPackageDependencyType  type,
wxPackageDependencyArray notfound = NULL 
) const

Returns *all* dependencies of this package recursively walking down the dependency tree.

Definition at line 422 of file package.cpp.

References DoGetRecursiveDependencies(), and wxPackageDependencyArray::Index().

wxArrayString wxPackage::GetIncludedFiles ( wxULongLong *  totalsize = NULL  )  const

Returns the list of the files matches by the inclusion criteria and not matches by the exclusion ones. If the argument is non-NULL then it's filled with the size of all the files to include.

Definition at line 812 of file package.cpp.

References GetDecompressionPath(), wxPackageDirTraverser::GetFiles(), wxPackageInfo::m_arrExcluded, and m_status.

Referenced by Compress().

bool wxPackage::LoadCompressedPackage ( const wxString &  wxzpath  ) 

Loads the given WXZ and returns true on success. Sets the status of this package to wxPS_DOWNLOADED.

Definition at line 608 of file package.cpp.

References GetInputStream(), SetDownloadedStatus(), and SetRelativeWXPPath().

Referenced by wxPackageRepositoryXMLDescriptor::AddPackage(), and wxPackageBrowserPanel::LoadCompressedPackage().

bool wxPackage::Decompress ( const wxString &  path,
wxProgressHandler *  handler = NULL 
)

Decompress this package in the given path. Since this can be a long operation, support for a user feedback is provided through the wxProgressHandler class.

Definition at line 653 of file package.cpp.

References GetDecompressedSize(), GetDownloadPath(), GetInputStream(), and SetDecompressedStatus().

bool wxPackage::Compress ( const wxString &  wxz = wxEmptyString,
wxProgressHandler *  handler = NULL 
)

Compress this package in the given output file (if not empty) or in the file name specified by wxPackageInfo::GetFileName() if wxz is the empty string. Uses wxLog facilities to log errors / warnings. The created package will include only files listed by GetIncludedFiles. Since this can be a long operation, support for a user feedback is provided through the wxProgressHandler class.

Definition at line 938 of file package.cpp.

References wxPackageInfo::GetCompressionMode(), GetDecompressionPath(), GetIncludedFiles(), wxPackageInfo::GetOutputFileName(), m_status, and wxPackageInfo::SubstituteInfo().

bool wxPackage::UploadWithFTP ( const wxString &  user = wxEmptyString,
const wxString &  password = wxEmptyString,
const wxString &  server = wxEmptyString,
const wxString &  path = wxEmptyString 
)

Uploads this package in the given path of the given server. If you provide empty strings for the various parameters they will be taken from the upload destination (see wxPackageInfo::GetUploadDestination).

Definition at line 1037 of file package.cpp.

References GetDownloadPath(), wxPackageInfo::GetUploadDestination(), and m_status.

void wxPackage::SetRemoteStatus ( const wxString &  downloadpath = wxEmptyString  ) 

Sets the package as remote (not downloaded yet). Optionally you can specify the path where the package is *being* downloaded. See m_strDownloadPath documentation.

Definition at line 186 of file package.cpp.

References m_status, m_strDownloadPath, and UpdatePackageInfo().

void wxPackage::SetRelativeWXPPath ( const wxString &  path  )  [inline]

Sets the relative path to the WXP file for this package. See m_strWXPPath for more info.

Definition at line 259 of file package.h.

References m_strWXPPath.

Referenced by LoadCompressedPackage().

void wxPackage::UpdatePackageInfo (  ) 

Updates the info associated with this package expanding local references if the package has been downloaded or removing them if the package is a remote package.

Definition at line 243 of file package.cpp.

References wxPackageInfo::m_arrDocumentation, wxPackageInfo::m_arrScreenshots, wxPackageInfo::m_refLogo, m_status, m_strDownloadPath, UpdateCompressedSize(), and UpdateMD5().

Referenced by LoadStatusInfo(), SetBuiltStatus(), SetDecompressedStatus(), SetDownloadedStatus(), SetInstalledStatus(), and SetRemoteStatus().

bool wxPackage::UpdateCompressedSize (  )  [inline]

Only valid when the status of this package is >= wxPS_DOWNLOADED; updates the compressed size of the package.

Definition at line 274 of file package.h.

References wxPackageInfo::m_nCompressedSize, m_status, and m_strDownloadPath.

Referenced by UpdatePackageInfo().

bool wxPackage::UpdateMD5 (  )  [inline]

Only valid when the status of this package is >= wxPS_DOWNLOADED; updates the MD5 string of the package.

Definition at line 294 of file package.h.

References m_status, m_strDownloadPath, and wxPackageInfo::m_strMD5.

Referenced by UpdatePackageInfo().

wxPackageCommand wxPackage::GetCmd ( const wxPackageCommand cmd,
wxPackageBuildSystemStage  stage,
long  flags,
const wxPackageCondition cond 
) const [protected, virtual]

Uses the current option values and the given stage to substitute variables inside the given wxPackageCommand and then returns it.

Reimplemented from wxPackageInfo.

Definition at line 164 of file package.cpp.

References wxPackageInfo::GetCmd(), wxPackageCommand::GetCommand(), wxPackageCommand::SetCommand(), and wxPackageInfo::SubstituteInfo().

void wxPackage::DoUpdateSubstitutionHashMap ( wxPackageSubstituteInfoContext  ctx  )  [protected, virtual]

Adds to wxPackageInfo's substitution hashmaps a few keywords about the package status (mainly useful for writing the build system commands rather than for writing viewformats).

Reimplemented from wxPackageInfo.

Definition at line 125 of file package.cpp.

References wxPackageInfo::DoUpdateSubstitutionHashMap(), wxPackageInfo::GetDownloadLink(), wxCompilerSettings::GetSubstitutionHashMap(), wxPackageInfo::m_buildSystemType, m_compiler, wxPackageInfo::m_hashmapSubstitution, m_status, and m_strDownloadPath.


Member Data Documentation

wxString wxPackage::m_strDownloadPath [protected]

When m_status is >= wxPS_DOWNLOADED: the path where the downloaded WXZ file has been placed. When m_status is wxPS_REMOTE: this is the path where the downloaded WXZ is going to be placed. This must be an absolute path fully qualified: path + name + extension. E.g. /home/me/packages/abc.wxz

Definition at line 350 of file package.h.

Referenced by DoUpdateSubstitutionHashMap(), GetDownloadPath(), LoadStatusInfo(), SaveStatusInfo(), SetDownloadedStatus(), SetRemoteStatus(), UpdateCompressedSize(), UpdateMD5(), and UpdatePackageInfo().

wxString wxPackage::m_strDecompressionPath [protected]

Valid only when m_status is >= wxPS_DECOMPRESSED: the directory of the package containing the decompressed WXZ, without the name of the decompressed folder. This must be an absolute path. E.g. supposing that abc.wxz has been decompressed in /home/me/packages and that the package folder name is abc-1.0.0, a valid decompression path is: /home/me/packages, not /home/me/packages/abc-1.0.0

Definition at line 360 of file package.h.

Referenced by GetAbsWXPPath(), GetDecompressionPath(), and SetDecompressionPath().

wxString wxPackage::m_strWXPPath [protected]

Valid only when m_status is >= wxPS_DECOMPRESSED: the path to the WXP file relative to the decompression folder. Thus, m_strDecompressionPath + m_strWXPPath == absolute location of the WXP. E.g. abc-1.0.0/build/abc.wxp (and in this case the relative root of the package should be "../../..")

Definition at line 368 of file package.h.

Referenced by GetAbsWXPPath(), GetRelativeWXPPath(), GetWXPFileName(), LoadStatusInfo(), SaveStatusInfo(), and SetRelativeWXPPath().

wxString wxPackage::m_strInstallationPath [protected]

Valid only when m_status is >= wxPS_INSTALLED: the directory where the package has been installed. This must be an absolute path. E.g. /usr/local

Definition at line 374 of file package.h.

Referenced by GetInstallationPath().


The documentation for this class was generated from the following files:
Generated on Thu Feb 1 22:14:32 2007 for wxWidgets Package Manager by  doxygen 1.5.1-p1