std::string_view 的使用
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include <string_view>
|
||||
|
||||
#include "global.h"
|
||||
|
||||
@@ -33,24 +34,24 @@ struct Schema_Only_Resource_Config {
|
||||
std::vector<std::string> primary_key_columns;
|
||||
};
|
||||
|
||||
std::string quote_identifier(const std::string &value);
|
||||
std::string normalize_key(std::string value);
|
||||
std::optional<std::string> normalize_field(std::string value);
|
||||
std::string quote_identifier(std::string_view value);
|
||||
std::string normalize_key(std::string_view value);
|
||||
std::optional<std::string> normalize_field(std::string_view value);
|
||||
void bind_optional(SQLite::Statement &statement, int index,
|
||||
const std::optional<std::string> &value);
|
||||
bool read_csv_row(std::istream &input, std::vector<std::string> &fields,
|
||||
char delimiter);
|
||||
std::string
|
||||
make_upsert_sql(const std::string &table_name,
|
||||
make_upsert_sql(std::string_view table_name,
|
||||
const std::vector<std::string> &columns,
|
||||
const std::vector<std::string> &primary_key_columns);
|
||||
void download_to_file(std::string url,
|
||||
void download_to_file(std::string_view url,
|
||||
const std::filesystem::path &target_file);
|
||||
void decompress_gzip(const std::filesystem::path &gzip_file,
|
||||
const std::filesystem::path &target_file);
|
||||
std::size_t import_header_csv(
|
||||
SQLite::Database &db, const std::filesystem::path &source_file,
|
||||
const std::string &table_name, const std::vector<std::string> &columns,
|
||||
std::string_view table_name, const std::vector<std::string> &columns,
|
||||
const std::vector<std::string> &primary_key_columns, char delimiter = ',');
|
||||
|
||||
std::unique_ptr<External_Resources>
|
||||
@@ -58,7 +59,7 @@ make_header_csv_resource(Header_Csv_Resource_Config config);
|
||||
std::unique_ptr<External_Resources>
|
||||
make_schema_only_resource(Schema_Only_Resource_Config config);
|
||||
std::unique_ptr<External_Resources>
|
||||
make_tar1090_aircraft_resource(std::string name, std::string description,
|
||||
make_tar1090_aircraft_resource(std::string_view name, std::string_view description,
|
||||
std::uint64_t update_interval_seconds);
|
||||
|
||||
} // namespace External_Database_Utils
|
||||
|
||||
Reference in New Issue
Block a user