T_H
#include "jsonevt.h"
#include "jsonevt_utils.h"
SV *
do_json_parse_buf(SV * self_sv, char * buf, STRLEN buf_len);
SV * do_json_parse(SV * self_sv, SV * json_str_sv);
SV * do_json_parse_file(SV
* self_sv, SV * file_sv);
SV * do_json_dummy_parse(SV *self_sv, SV * json_str_sv);
#endif
.
*/
/* $Revision$ */
#ifndef JSONEVT_PRIVATE_H
#define JSONEVT_PRIVATE_H
#include "jsonevt.h"
#include "utf8.h"
#include "print.h"
#include "jsonevt_utils.h"
JSON_DO_CPLUSPLUS_WRAP_BEGIN
#inclu
char * buf;
uint len;
} json_datum;
struct context_flags_struct {
int have_char:1;
int pad:7;
};
typedef struct json_extern_ctx json_context;
struct json_extern_ctx {
const char *
d * cb_data;
json_string_cb string_cb;
json_array_begin_cb begin_array_cb;
json_array_end_cb end_array_cb;
json_array_begin_element_cb begin_array_element_cb;
json_array_end_elemen
*/
#ifndef JSONEVT_H
#define JSONEVT_H
#include <sys/types.h>
#include <stdio.h>
#include <jsonevt_config.h>
#ifdef JSONEVT_DEF_HAVE_INTTYPES_H
#include <inttypes.h>
#else
#ifdef JSONEVT_DEF_HAVE
lusplus
#define JSON_DO_CPLUSPLUS_WRAP_BEGIN extern "C" {
#define JSON_DO_CPLUSPLUS_WRAP_END }
#else
#define JSON_DO_CPLUSPLUS_WRAP_BEGIN
#define JSON_DO_CPLUSPLUS_WRAP_END
#endif
JSON_DO_CPLUSPLUS_W
WIN32)
#define JSONEVT_ON_WINDOWS
#endif
#ifdef _MSC_VER
/* Microsoft Visual C++ */
#if _MSC_VER >= 1400
/* MS Visual C++ 2005 */
#define JSONEVT_HAVE_FULL_VARIADIC_MACROS
#define JSONEVT_HAVE_VARIAD
=pod
=head1 NAME
JSON::DWIW::Changes - List of significant changes to JSON::DWIW
=head1 CHANGES
=head2 VERSION 0.47
=over 4
=item Added the I<start_depth> and I<start_depth_handler> options
=b
n converting to JSON
=back
=head2 Version 0.42
=over 4
=item Documentation fixes.
=item Fixed bug where numbers got coerced to strings when encoding, such that if you call to_json() again on the
m Fixed configuration problem for libjsonevt on Mac OS X
=item Documentation formatting fixes.
=back
=head2 Version 0.40
=over 4
=item Includes updates to jsonevt to fix parsing bug (segfault whe
VERSION = '0.102740';
}
# ABSTRACT: Subroutines for internal use
use strict;
use warnings;
use JSON;
use LWP::UserAgent;
use Scalar::Util qw{ blessed };
use URI::Escape;
# transform hash keys and
MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
*/
/* $Header: /repository/owens_lib/cpan/JSON/DWIW/DWIW.h,v 1.3 2009-04-11 02:18:37 don Exp $ */
#ifndef DWIW_H
#define DWIW_H
#ifdef __cplus
ine IS_PERL_5_6
#endif
#endif
#define DEBUG_UTF8 0
#define JSON_DO_DEBUG 0
#define JSON_DO_TRACE 0
#define JSON_DUMP_OPTIONS 0
#define JSON_DO_EXTENDED_ERRORS 0
#include <stdarg.h>
#define MAYBE_US
#ifdef HAVE_JSONEVT
#include "evt.h"
#endif
#define debug_level 9
#ifndef PERL_MAGIC_tied
#define PERL_MAGIC_tied 'P' /* Tied array or hash */
#endif
#define MOD_NAME "JSON::DWIW"
#defi
ts;
use JSON;
subtype 'List::id'
=> as 'Str'
=> where { $_ =~ /^(?:\d;?)+$/ };
subtype 'JSON::XS::Boolean'
=> as 'JSON::XS::Boolean';
subtype 'JSON::PP::Boolean'
=> as 'JSON::PP::Bo
'
=> from 'JSON::XS::Boolean'
=> via {
if ( JSON::is_bool($_) && $_ == JSON::true ) {
return 'true';
}
return 'false';
}
=> from 'JSON::PP::Boolean'
=> via {
if ( JSON::is_bool($_) && $_ == JSON::true ) {
return 'true';
}
return 'false';
}
=> from 'Int'
=> via {
if ($_) {
ret
ABSTRACT: Request methods for answers
use Moose;
use Moose::Util::TypeConstraints;
use JSON qw{ decode_json };
with 'Net::StackExchange::Role::Request';
has 'id' => (
is => 'ro',
is
$self = shift;
my $json = Net::StackExchange::Core::_execute($self);
my $se = $self->_NSE();
my $json_decoded = decode_json($json);
my $response = Net::Stac
=> $se,
'_json_decoded' => $json_decoded,
'json' => $json,
'total' => $json_decoded->{'total' },
'page' => $json_decoded->{'page' },
package VT::API;
use strict;
use Carp;
use JSON;
use HTTP::Request::Common;
use LWP::UserAgent;
our $VERSION = '0.12';
sub new {
croak('Options to VT::API should be key/value pairs,
ustotal.com/api/get_file_report.json', [
resource => $resource,
key => $self->{key},
],
);
return $self->_parse_json();
}
sub scan_file {
file.json',
Content_Type => 'form-data',
Content => [
file => [$file],
key => $self->{key},
],
);
return $self->_parse_json();
{} , $class;
}
=head2 mimeType
Getter
=cut
sub mimeType{
# Ideal
#return 'application/json' ;
# Reality
return 'application/x-perl';
}
=head2 asBytes
Returns the response as yaml
package Business::AU::Ledger::View::Context;
use Business::AU::Ledger::Util::Validate;
use JSON::XS;
use Moose;
extends 'Business::AU::Ledger::View::Base';
use namespace::autoclean;
our $VERSION
me => 'No output produced'}]};
}
}
$self -> log(__PACKAGE__ . '. Leaving process');
return JSON::XS -> new -> encode($output);
} # End of process.
# ------------------------------------------
', isa => 'Str', default => 'us1');
has 'output_format' => (is => 'rw', isa => 'Str', default => 'json');
sub BUILD {
my ( $self ) = @_;
die 'apikey or username and password is required
package Business::AU::Ledger::View::Reconciliation;
use JSON::XS;
use Moose;
extends 'Business::AU::Ledger::View::Base';
use namespace::autoclean;
our $VERSION = '0.88';
# ----------------------
'},
receipts => 0.00,
};
}
$self -> log(__PACKAGE__ . '. Leaving initialize');
return JSON::XS -> new -> encode({results => [@output]});
} # End of initialize.
# ------------------------
ss::AU::Ledger::View::Receipt;
use Business::AU::Ledger::Util::Validate;
use Date::Simple;
use JSON::XS;
use Moose;
extends 'Business::AU::Ledger::View::Base';
has field_width => (is => 'rw', is
@$output, $self -> format_fields;
$self -> log(__PACKAGE__ . '. Leaving initialize');
return JSON::XS -> new -> encode({results => $output});
} # End of initialize.
# --------------------------
;
$self -> log(__PACKAGE__ . ". Leaving submit. Row count now: @{[scalar @$output]}");
return JSON::XS -> new -> encode({results => $output});
} # End of submit.
# ------------------------------
from the fmt parameter. For instance '?fmt=json'
extension - With this method, the writer is selected from the url extension. For instance : '/test.json'
header - With this method, the writer
When using 'param' (default) ask for json format like this: http://localhost/test/?fmt=json
When using 'extension' : http://localhost/test.json
=head3 Apache2RESTWriterDefault
Sets the d
efault writer. If ommitted, the default is C<xml>. Available writers are C<xml>, C<json>, C<yaml>, C<perl>, C<bin>
=head2 command line REST client
This module comes with a commandline REST client to
package Apache2::REST::Writer::bin ;
use strict ;
use JSON::XS ;
use Data::Dumper ;
=head1 NAME
Apache2::REST::Writer::bin - Apache2::REST::Response Writer for binary
=head1 DESCRIPTION
This wri
->binMimeType() ;
}
return 'application/bin' ;
}
=head2 asBytes
Returns the response as json UTF8 bytes for output.
=cut
sub asBytes{
my ($self, $resp ) = @_ ;
return $resp->
ss::AU::Ledger::View::Payment;
use Business::AU::Ledger::Util::Validate;
use Date::Simple;
use JSON::XS;
use Moose;
extends 'Business::AU::Ledger::View::Base';
has field_width => (is => 'rw', is
@$output, $self -> format_fields;
$self -> log(__PACKAGE__ . '. Leaving initialize');
return JSON::XS -> new -> encode({results => $output});
} # End of initialize.
# --------------------------
;
$self -> log(__PACKAGE__ . ". Leaving submit. Row count now: @{[scalar @$output]}");
return JSON::XS -> new -> encode({results => $output});
} # End of submit.
# ------------------------------
r;
use File::MimeInfo qw( mimetype );
use File::Slurp qw( read_file );
use HTML::Tidy;
use JSON qw( from_json );
use Kwiki ();
use Kwiki::Attachments ();
use Path::Class qw( dir file );
u
user {
return 0;
}
sub _build_user_map {
my $self = shift;
my $map;
$map = from_json( read_file( $self->user_map_file() ) )
if $self->has_user_map_file;
$map ||= {};
--kwiki-root /path/to/kwiki \
--user-map-file /path/to/map.json \
--default-user DefaultNameFromKwiki \
--fast
SILKIX_CONVERT
e JSON::XS;
use Exporter;
use base qw/Exporter/;
use vars qw/$VERSION @EXPORT_OK $parser/;
BEGIN {
$VERSION = 0.02;
@EXPORT_OK = qw/ JSONObject2Perl ordrsp_data pretty_json /;
}
sub JSONOb
= JSONObject2Perl($obj->{$k}) unless ref $obj->{$k} eq 'JSON::XS::Boolean';
}
} elsif ( ref $obj eq 'ARRAY' ) {
for my $i (0..scalar(@$obj) - 1) {
$obj->[$i] = JSONObj
bj->[$i] eq 'JSON::XS::Boolean';
}
}
# ELSE: return vivified non-class hashes, all arrays, and anything that isn't a hash or array ref
return $obj;
}
sub pretty_json {
@_ or
:EDI-new('d09b'); # set the EDI spec version
my $rtc = $edi->codelist('ResponseTypeCode', $json) or die "Unrecognized code!";
printf "EDI response type: %s - %s (%s)\n", $rtc->code, $rtc->lab
to EDI messages and subelements.
At present, the EDI input processed by Business::EDI objects is JSON from the B<edi4r> ruby library, and
there is no EDI output beyond the perl objects themselves.
=