Make wxWebResponse::Init() and Finalize() non-public

The former can be called from the derived class ctors while the latter
only needs to be called from wxWebRequest itself, so just make it a
friend: this is not ideal, but still better than leaving this public and
simpler than any alternatives.
This commit is contained in:
Vadim Zeitlin
2020-12-13 01:33:01 +01:00
parent 1c61fe6baf
commit 8ea4f38689
5 changed files with 21 additions and 11 deletions

View File

@@ -154,10 +154,6 @@ public:
wxString AsString() const;
bool Init();
void Finalize();
virtual wxString GetFileName() const;
protected:
@@ -166,15 +162,24 @@ protected:
wxWebResponse(wxWebRequest& request);
// Called from derived class ctor to finish initialization which can't be
// performed in ctor itself as it needs to use pure virtual method.
void Init();
void* GetDataBuffer(size_t sizeNeeded);
void ReportDataReceived(size_t sizeReceived);
private:
// Called by wxWebRequest only.
void Finalize();
wxMemoryBuffer m_readBuffer;
mutable wxFFile m_file;
mutable wxScopedPtr<wxInputStream> m_stream;
friend class wxWebRequest;
wxDECLARE_NO_COPY_CLASS(wxWebResponse);
};