lftp
4.4.6
About:
lftp
is a command line ftp client (FTP, HTTP, ssl support, background transfer, reget, reput, ...)
Fossies
Dox
:
lftp-4.4.6.tar.gz
("inofficial" and yet experimental doxygen-generated source code documentation)
Main Page
Modules
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
ArgV.h
Go to the documentation of this file.
1
/*
2
* lftp - file transfer program
3
*
4
* Copyright (c) 1996-2012 by Alexander V. Lukyanov (lav@yars.free.net)
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef ARGV_H
21
#define ARGV_H
22
23
#include "
trio.h
"
24
#include "
StringSet.h
"
25
#include "getopt.h"
26
27
class
ArgV
:
public
StringSet
28
{
29
int
ind;
30
31
public
:
32
ArgV
() { ind=0; }
33
ArgV
(
const
char
*
a0
) :
StringSet
(&a0,1) { ind=0; }
34
ArgV
(
const
char
*
a0
,
const
char
*
args
);
35
ArgV
(
const
ArgV
&
a
) :
StringSet
(a) { ind=0; }
36
ArgV
(
const
ArgV
*
a
) :
StringSet
(*a) { ind=0; }
37
ArgV
(
int
new_c,
const
char
*
const
*new_v) :
StringSet
(new_v,new_c) { ind=0; }
38
~ArgV
();
39
40
void
Append
(
const
char
*
s
) {
StringSet::Append
(s); }
41
void
Append
(
int
a
) {
char
buf[32]; sprintf(buf,
"%d"
,a);
Append
(buf); }
42
void
Add
(
const
char
*
a
) {
Append
(a); }
// alias
43
44
char
*
Combine
(
int
start_index=0,
int
end_index=0)
const
;
45
char
*
CombineQuoted
(
int
start_index=0)
const
;
46
char
*
CombineCmd
(
int
i=0)
const
;
47
48
int
getopt_long
(
const
char
*opts,
const
struct
option
*lopts,
int
*lind=0);
49
int
getopt
(
const
char
*opts)
50
{
51
return
getopt_long
(opts,0,0);
52
}
53
const
char
*
getopt_error_message
(
int
e);
54
55
void
seek
(
int
n
);
56
void
rewind
() {
seek
(0); }
57
const
char
*
getnext
();
58
59
const
char
*
getarg
(
int
n
)
const
{
return
String
(n); }
60
const
char
*
getcurr
()
const
{
return
ind<
Count
()?
getarg
(ind):0; }
61
int
getindex
()
const
{
return
ind; }
62
void
setarg
(
int
n
,
const
char
*
s
) {
Replace
(n,s); }
63
void
delarg
(
int
n
) {
if
(ind>n)--ind;
Remove
(n); }
64
void
insarg
(
int
n
,
const
char
*
s
) {
InsertBefore
(n,s); }
65
const
char
*
a0
()
const
{
return
getarg
(0); }
66
void
back
();
67
int
count
()
const
{
return
Count
(); }
68
const
char
*
const
*
GetV
()
const
{
return
Set
(); }
69
char
**
GetVNonConst
() {
return
SetNonConst
(); }
70
};
71
72
#endif//ARGV_H
lftp-4.4.6
src
ArgV.h
Generated by
1.8.3.1-20130512