line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Gnats::Command::QFMT; |
2
|
40
|
|
|
40
|
|
178
|
use parent 'Net::Gnats::Command'; |
|
40
|
|
|
|
|
53
|
|
|
40
|
|
|
|
|
190
|
|
3
|
40
|
|
|
40
|
|
2234
|
use strictures; |
|
40
|
|
|
|
|
68
|
|
|
40
|
|
|
|
|
175
|
|
4
|
|
|
|
|
|
|
BEGIN { |
5
|
40
|
|
|
40
|
|
3412
|
$Net::Gnats::Command::QFMT::VERSION = '0.21'; |
6
|
|
|
|
|
|
|
} |
7
|
40
|
|
|
40
|
|
206
|
use vars qw($VERSION); |
|
40
|
|
|
|
|
75
|
|
|
40
|
|
|
|
|
1999
|
|
8
|
|
|
|
|
|
|
|
9
|
40
|
|
|
40
|
|
389
|
use Net::Gnats::Constants qw(CODE_OK CODE_CMD_ERROR CODE_INVALID_QUERY_FORMAT); |
|
40
|
|
|
|
|
58
|
|
|
40
|
|
|
|
|
8594
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Net::Gnats::Command::QFMT |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Use the specified query format to format the output of the QUER |
18
|
|
|
|
|
|
|
command. The query format may be either the name of a query format |
19
|
|
|
|
|
|
|
known to the server (see Named query definitions), or an actual |
20
|
|
|
|
|
|
|
query format (see Formatting query-pr output). |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 PROTOCOL |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
QFMT |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 RESPONSES |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
The possible |
29
|
|
|
|
|
|
|
responses are: |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
210 (CODE_OK) The normal response, which indicates that the query |
32
|
|
|
|
|
|
|
format is acceptable. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
440 (CODE_CMD_ERROR) No query format was supplied. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
418 (CODE_INVALID_QUERY_FORMAT) The specified query format does not |
37
|
|
|
|
|
|
|
exist, or could not be parsed. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my $c = 'QFMT'; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub new { |
44
|
15
|
|
|
15
|
1
|
54
|
my ( $class, %options ) = @_; |
45
|
|
|
|
|
|
|
|
46
|
15
|
|
|
|
|
49
|
my $self = bless \%options, $class; |
47
|
15
|
|
|
|
|
54
|
return $self; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub as_string { |
51
|
29
|
|
|
29
|
1
|
38
|
my $self = shift; |
52
|
29
|
100
|
|
|
|
104
|
return undef if not defined $self->{format}; |
53
|
28
|
|
|
|
|
97
|
return $c . ' ' . $self->{format}; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub is_ok { |
57
|
15
|
|
|
15
|
0
|
29
|
my $self = shift; |
58
|
15
|
100
|
|
|
|
43
|
return 0 if not defined $self->response; |
59
|
14
|
50
|
|
|
|
41
|
return 1 if $self->response->code == CODE_OK; |
60
|
0
|
|
|
|
|
|
return 0; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |