| 1 | # | ||
| 2 | # Copyright 2016 MongoDB, Inc. | ||
| 3 | # | ||
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | # you may not use this file except in compliance with the License. | ||
| 6 | # You may obtain a copy of the License at | ||
| 7 | # | ||
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | # | ||
| 10 | # Unless required by applicable law or agreed to in writing, software | ||
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | # See the License for the specific language governing permissions and | ||
| 14 | # limitations under the License. | ||
| 15 | |||
| 16 | 58 | ▶ | use 5.010001; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | 58 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | 58 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | |||
| 20 | package BSON::XS; | ||
| 21 | # ABSTRACT: XS implementation of MongoDB's BSON serialization | ||
| 22 | |||
| 23 | 58 | ▶ | use version; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 24 | 58 | our $VERSION = 'v0.8.2'; | |
| 25 | |||
| 26 | # cached for efficiency during decoding | ||
| 27 | # XXX eventually move this into XS | ||
| 28 | 58 | ▶ | use boolean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 29 | 58 | our $_boolean_true = true; | |
| 30 | 58 | our $_boolean_false = false; | |
| 31 | |||
| 32 | 58 | ▶ | use XSLoader; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 33 | 58 | XSLoader::load( "BSON::XS", $VERSION ); | |
| 34 | |||
| 35 | # For errors | ||
| 36 | sub _printable { | ||
| 37 | 1 | ▶ | my $value = shift; |
|
Subroutine
_printable: called CC=1 SCAR=0.0
| |||
| 38 | 1 | $value =~ s/([^[:print:]])/sprintf("\\x%02x",ord($1))/ge; | |
| 39 | 1 | return $value; | |
| 40 | } | ||
| 41 | |||
| 42 | 58 | 1; | |
| 43 | |||
| 44 | =pod | ||
| 45 | |||
| 46 | =encoding UTF-8 | ||
| 47 | |||
| 48 | =head1 NAME | ||
| 49 | |||
| 50 | BSON::XS - XS implementation of MongoDB's BSON serialization | ||
| 51 | |||
| 52 | =head1 VERSION | ||
| 53 | |||
| 54 | version v0.8.2 | ||
| 55 | |||
| 56 | =head1 END OF LIFE NOTICE | ||
| 57 | |||
| 58 | Version v0.8.0 is the final feature release of the MongoDB BSON::XS | ||
| 59 | library. The library is now in a 12-month "sunset" period and will | ||
| 60 | receive security patches and critical bug fixes only. The BSON::XS | ||
| 61 | library will be end-of-life and unsupported on August 13, 2020. | ||
| 62 | |||
| 63 | =head1 DESCRIPTION | ||
| 64 | |||
| 65 | This module contains an XS implementation for BSON encoding and | ||
| 66 | decoding. There is no public API. Use the L<BSON> module and it will | ||
| 67 | choose the best implementation for you. | ||
| 68 | |||
| 69 | =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan | ||
| 70 | |||
| 71 | =head1 SUPPORT | ||
| 72 | |||
| 73 | =head2 Bugs / Feature Requests | ||
| 74 | |||
| 75 | Please report any bugs or feature requests through the issue tracker | ||
| 76 | at L<https://jira.mongodb.org/browse/PERL>. | ||
| 77 | You will be notified automatically of any progress on your issue. | ||
| 78 | |||
| 79 | =head2 Source Code | ||
| 80 | |||
| 81 | This is open source software. The code repository is available for | ||
| 82 | public review and contribution under the terms of the license. | ||
| 83 | |||
| 84 | L<https://github.com/mongodb/mongo-perl-bson-xs> | ||
| 85 | |||
| 86 | git clone https://github.com/mongodb/mongo-perl-bson-xs.git | ||
| 87 | |||
| 88 | =head1 AUTHOR | ||
| 89 | |||
| 90 | David Golden <david@mongodb.com> | ||
| 91 | |||
| 92 | =head1 CONTRIBUTOR | ||
| 93 | |||
| 94 | =for stopwords Paul "LeoNerd" Evans | ||
| 95 | |||
| 96 | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | ||
| 97 | |||
| 98 | =head1 COPYRIGHT AND LICENSE | ||
| 99 | |||
| 100 | This software is Copyright (c) 2019 by MongoDB, Inc. | ||
| 101 | |||
| 102 | This is free software, licensed under: | ||
| 103 | |||
| 104 | The Apache License, Version 2.0, January 2004 | ||
| 105 | |||
| 106 | =cut | ||
| 107 | |||
| 108 | __END__ | ||