forked from opencor/libopencor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libCOMBINE: allow a COMBINE archive to be initialised using some file…
… contents.
- Loading branch information
Showing
205 changed files
with
9,463 additions
and
2,042 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
afterAll(() => { | ||
IssuePtrs mErrors; | ||
return !mErrors.empty(); | ||
mErrors.push_back(issue); | ||
return mErrors.size(); | ||
return mErrors; | ||
mErrors.push_back(issue); | ||
mErrors.clear(); | ||
return pimpl()->mErrors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
Copyright libOpenCOR contributors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#include "../extern/modp_b64/modp_b64.h" | ||
|
||
#include <filesystem> | ||
#include <fstream> | ||
#include <iostream> | ||
|
||
int main(int pArgC, char *pArgV[]) | ||
{ | ||
// Convert the given file to a base64-encoded string. | ||
|
||
if (pArgC != 2) { | ||
std::cerr << "Usage: " << pArgV[0] << " <file>" << std::endl; | ||
|
||
return 1; | ||
} | ||
|
||
std::uintmax_t fileSize = std::filesystem::file_size(pArgV[1]); | ||
char *buffer = new char[fileSize]; | ||
std::ifstream file(pArgV[1], std::ios::binary); | ||
|
||
file.read(buffer, fileSize); | ||
|
||
if (!file) { | ||
std::cerr << "Error: the file could not be read." << std::endl; | ||
|
||
return 1; | ||
} | ||
|
||
file.close(); | ||
|
||
char *base64 = new char[modp_b64_encode_len(fileSize)]; | ||
|
||
modp_b64_encode(base64, buffer, fileSize); | ||
|
||
std::cout << base64 << std::endl; | ||
|
||
delete[] base64; | ||
delete[] buffer; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
`libOpenCOR <https://opencor.ws/libopencor/index.html>`__ relies on the following external projects: | ||
|
||
- `GoogleTest <https://github.com/google/googletest>`__ `1.15.2 <https://github.com/google/googletest/releases/tag/v1.15.2>`__; and | ||
- `GoogleTest <https://github.com/google/googletest>`__ `1.15.2 <https://github.com/google/googletest/releases/tag/v1.15.2>`__; | ||
- `modp_b64 <https://chromium.googlesource.com/chromium/src/third_party/modp_b64/>`__ at commit `7c1b327 <https://chromium.googlesource.com/chromium/src/third_party/modp_b64/+/7c1b3276e72757e854b5b642284aa367436a4723>`__; and | ||
- `nanobind <https://github.com/wjakob/nanobind>`__ `2.1.0 <https://github.com/wjakob/nanobind/releases/tag/v2.1.0>`__. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright 2013 The Chromium Authors | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
static_library("modp_b64") { | ||
sources = [ | ||
"modp_b64.cc", | ||
"modp_b64.h", | ||
"modp_b64_data.h", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include_rules = [ | ||
'+build', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
monorail: { | ||
component: "Internals" | ||
} | ||
buganizer_public: { | ||
component_id: 1456292 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
* MODP_B64 - High performance base64 encoder/decoder | ||
* Version 1.3 -- 17-Mar-2006 | ||
* http://modp.com/release/base64 | ||
* | ||
* Copyright (c) 2005, 2006 Nick Galbreath -- nickg [at] modp [dot] com | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are | ||
* met: | ||
* | ||
* Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* | ||
* Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* | ||
* Neither the name of the modp.com nor the names of its | ||
* contributors may be used to endorse or promote products derived from | ||
* this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pkasting@chromium.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Name: modp base64 decoder | ||
Short Name: stringencoders | ||
URL: https://github.com/client9/stringencoders | ||
Version: 2.0.0 | ||
Revision: 26701a1c1fcb98ae43eefcaee23abc58459a6e59 | ||
License: BSD-3-Clause | ||
License File: LICENSE | ||
Security Critical: yes | ||
Shipped: yes | ||
|
||
Description: | ||
The source code was modified from upstream as follows: | ||
- Removed the inclusion of modp's config.h | ||
- Fixed compilation errors that occur under VC8 | ||
- Renamed modp_b64.c to modp_b64.cc to force it to be compiled as C++ and so | ||
the inclusion of basictypes.h could be possible | ||
- Made code safe on 64-bit systems | ||
- Removed misaligned read/writes on little-endian systems | ||
- Removed unreachable code | ||
- Extended the API so callers can avoid overload for base64 encode | ||
- Removed big endian support entirely | ||
- Removed std::string APIs | ||
- Added multiple decoding options to support Blink callers | ||
- Added modp_b64_encode_data which doesn't append a null terminator |
Oops, something went wrong.