| 1 | package Net::Gnats::Command::QFMT; | ||||||||||
| 2 | 40 | ▶ | use parent 'Net::Gnats::Command'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 40 | ▶ | use strictures; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 40 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 40 | $Net::Gnats::Command::QFMT::VERSION = '0.22'; | |||||||||
| 6 | } | ||||||||||
| 7 | 40 | ▶ | use vars qw($VERSION); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 40 | ▶ | use Net::Gnats::Constants qw(CODE_OK CODE_CMD_ERROR CODE_INVALID_QUERY_FORMAT); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 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 <query format> | ||||||||||
| 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 | 40 | my $c = 'QFMT'; | |||||||||
| 42 | |||||||||||
| 43 | 15 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 44 | 15 | my ( $class, %options ) = @_; | |||||||||
| 45 | |||||||||||
| 46 | 15 | my $self = bless \%options, $class; | |||||||||
| 47 | 15 | return $self; | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 29 | ▶ | sub as_string { | ||||||||
|
Subroutine
as_string: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 51 | 29 | my $self = shift; | |||||||||
| 52 | 29 | ▶ | return undef if not defined $self->{format}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 53 | 28 | return $c . ' ' . $self->{format}; | |||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | 15 | ▶ | sub is_ok { | ||||||||
|
Subroutine
is_ok: called CC=3 SCAR=11.4
Pod
undocumented
| |||||||||||
| 57 | 15 | my $self = shift; | |||||||||
| 58 | 15 | ▶ | return 0 if not defined $self->response; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | 14 | ▶ | return 1 if $self->response->code == CODE_OK; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 60 | 0 | return 0; | |||||||||
| 61 | } | ||||||||||
| 62 | |||||||||||
| 63 | 40 | 1; | |||||||||