.. _program_listing_file_lib_utilities_string.hpp: Program Listing for File string.hpp =================================== |exhale_lsh| :ref:`Return to documentation for file ` (``lib/utilities/string.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp // --------------------------------------------------------------------- // This file is part of falcon-core. // // Copyright (C) 2015, 2016, 2017 Neuro-Electronics Research Flanders // // Falcon-server is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Falcon-server is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with falcon-core. If not, see . // --------------------------------------------------------------------- /* Utilities to manipulate, create and check string data and other containers with strings. */ #pragma once #include #include #include #include #include bool path_exists(const std::string &name); std::vector &split(const std::string &s, char delim, std::vector &elems); std::vector split(const std::string &s, char delim); template std::string join(const std::vector &s, std::string delim = ","); std::string resolve_server_path(std::string p, const std::map &contexts, std::string default_context = ""); template std::string to_string_n(const T a_value, const int n = 1); template T from_string(std::string s); // removes the appended (complete or incomplete) filename from the path // and returns the path to the folder; // returned path ends with '/' std::string extract_path_to_folder(std::string path_to_file); // std::string complete_path(std::string file_path, std::string processor_name, std::string extension); template inline std::string get_type_string() { return "unknown"; } template <> inline std::string get_type_string() { return "bool"; } template <> inline std::string get_type_string() { return "float64"; } template <> inline std::string get_type_string() { return "float32"; } template <> inline std::string get_type_string() { return "int8"; } template <> inline std::string get_type_string() { return "uint8"; } template <> inline std::string get_type_string() { return "int16"; } template <> inline std::string get_type_string() { return "uint16"; } template <> inline std::string get_type_string() { return "int32"; } template <> inline std::string get_type_string() { return "uint32"; } template <> inline std::string get_type_string() { return "int64"; } template <> inline std::string get_type_string() { return "uint64"; } template <> inline std::string get_type_string() { return "char"; } #include "string.ipp"