/src/flatbuffers/src/file_name_manager.cpp
Line | Count | Source |
1 | | /* |
2 | | * Copyright 2023 Google Inc. All rights reserved. |
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 | | |
17 | | #include <iostream> |
18 | | #include <tuple> |
19 | | |
20 | | #include "flatbuffers/file_manager.h" |
21 | | |
22 | | namespace flatbuffers { |
23 | | |
24 | | bool FileNameSaver::SaveFile(const char* name, const char* buf, size_t len, |
25 | 0 | bool binary) { |
26 | 0 | (void)buf; |
27 | 0 | (void)len; |
28 | 0 | (void)binary; |
29 | |
|
30 | 0 | std::ignore = file_names_.insert(name); |
31 | | |
32 | | // we want to simulate always successful save |
33 | 0 | return true; |
34 | 0 | } |
35 | | |
36 | 0 | void FileNameSaver::Finish() { |
37 | 0 | for (const auto& file_name : file_names_) { |
38 | | // Just print the file names to standard output. |
39 | | // No actual file is created. |
40 | 0 | std::cout << file_name << "\n"; |
41 | 0 | } |
42 | 0 | } |
43 | | |
44 | | } // namespace flatbuffers |