3dfb8bc889
Make the code that creates BuiltinArguments instances easier to read by using initializer lists instead of constructor calls. Remove the BuiltinArguments constructors. Change-Id: I6cf215a81d298cf7e524e22fb75db820e0225c9a Signed-off-by: Bart Van Assche <bvanassche@google.com>
39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
/*
|
|
* Copyright (C) 2017 The Android Open Source Project
|
|
*
|
|
* 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.
|
|
*/
|
|
|
|
#ifndef _INIT_BUILTIN_ARGUMENTS_H
|
|
#define _INIT_BUILTIN_ARGUMENTS_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace android {
|
|
namespace init {
|
|
|
|
struct BuiltinArguments {
|
|
const std::string& operator[](std::size_t i) const { return args[i]; }
|
|
auto begin() const { return args.begin(); }
|
|
auto end() const { return args.end(); }
|
|
auto size() const { return args.size(); }
|
|
|
|
std::vector<std::string> args;
|
|
const std::string& context;
|
|
};
|
|
|
|
} // namespace init
|
|
} // namespace android
|
|
|
|
#endif
|