Qore Programming Language  1.12.0
QC_FtpClient.h
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3  QC_FtpClient.h
4 
5  QoreFtpClient class
6 
7  Qore Programming Language
8 
9  Copyright (C) 2003 - 2022 Qore Technologies, s.r.o.
10 
11  Permission is hereby granted, free of charge, to any person obtaining a
12  copy of this software and associated documentation files (the "Software"),
13  to deal in the Software without restriction, including without limitation
14  the rights to use, copy, modify, merge, publish, distribute, sublicense,
15  and/or sell copies of the Software, and to permit persons to whom the
16  Software is furnished to do so, subject to the following conditions:
17 
18  The above copyright notice and this permission notice shall be included in
19  all copies or substantial portions of the Software.
20 
21  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  DEALINGS IN THE SOFTWARE.
28 
29  Note that the Qore library is released under a choice of three open-source
30  licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more
31  information.
32 */
33 
34 #ifndef _QORE_CLASS_FTPCLIENT_H
35 
36 #define _QORE_CLASS_FTPCLIENT_H
37 
38 #include <qore/AbstractPrivateData.h>
39 #include <qore/QoreFtpClient.h>
40 
41 DLLEXPORT extern qore_classid_t CID_FTPCLIENT;
42 DLLLOCAL extern QoreClass* QC_FTPCLIENT;
43 
44 DLLLOCAL QoreClass *initFtpClientClass(QoreNamespace& ns);
45 DLLLOCAL TypedHashDecl* init_hashdecl_FtpResponseInfo(QoreNamespace& ns);
46 
47 class QoreFtpClientClass : public AbstractPrivateData, public QoreFtpClient {
48 public:
49  DLLLOCAL inline QoreFtpClientClass() {}
50 
51  DLLLOCAL inline QoreFtpClientClass(const QoreString *url, ExceptionSink *xsink) : QoreFtpClient(url, xsink) {}
52 
54  DLLLOCAL virtual void deref(ExceptionSink *xsink) {
55  if (ROdereference()) {
56  cleanup(xsink);
57  delete this;
58  }
59  }
60 
61  DLLLOCAL const char* getUrlPath() const;
62 
63 protected:
64  DLLLOCAL virtual ~QoreFtpClientClass() {}
65 };
66 
67 #endif // _QORE_CLASS_FTPCLIENT_H
the base class for all data to be used as private data of Qore objects
Definition: AbstractPrivateData.h:44
virtual DLLLOCAL void deref()
decrements the reference count of the object without the possibility of throwing a Qore-language exce...
Definition: AbstractPrivateData.h:65
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
defines a Qore-language class
Definition: QoreClass.h:249
provides thread-safe access to FTP servers through Qore data structures
Definition: QoreFtpClient.h:71
contains constants, classes, and subnamespaces in QoreProgram objects
Definition: QoreNamespace.h:65
DLLEXPORT bool ROdereference() const
atomically decrements the reference count
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:93
typed hash declaration
Definition: TypedHashDecl.h:44
unsigned qore_classid_t
used for the unique class ID for QoreClass objects
Definition: common.h:79