split.hpp

来自「LiteSQL is a C++ library that integrates」· HPP 代码 · 共 37 行

HPP
37
字号
/* LiteSQL  *  * By Tero Laitinen  *  * See LICENSE for copyright information. *//** \file split.hpp    contains class Split */#ifndef _litesql_split_hpp#define _litesql_split_hpp#include <string>#include <vector>namespace litesql {/** splits and joins strings. Modelled with Python's strings in mind. */class Split : public std::vector<std::string> {public:    /** empty split */    Split() {}    /** from string vector */    Split(std::vector<std::string> data)         : std::vector<std::string>(data) {}    /** from string. Split to parts using delimeter */    Split(std::string s, std::string delim=" ");    /** returns a part of strings      \param start starting index     \param end ending index     Indexes can be negative; actual index is calculated from the end of      Split then.*/    Split slice(int start, int end) const;    /** returns strings joined with delimiter */    std::string join(std::string delim) const;    /** adds contents of another split to the end */    Split & extend(const Split & s);};}#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?