Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
comFunction.cpp@45:3b51dd26b579, 2019-02-13 (annotated)
- Committer:
- MasashiNomura
- Date:
- Wed Feb 13 11:55:39 2019 +0000
- Revision:
- 45:3b51dd26b579
- Parent:
- 17:f9610f3cfa1b
20190208 change and add comment. add setting val to fpga every-timing.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| MasashiNomura | 45:3b51dd26b579 | 1 | /** |
| MasashiNomura | 45:3b51dd26b579 | 2 | * @file comFunction.cpp |
| MasashiNomura | 45:3b51dd26b579 | 3 | * @brief STDLIBを使用した文字列を扱う関数定義 |
| MasashiNomura | 45:3b51dd26b579 | 4 | * @author Nomura |
| MasashiNomura | 45:3b51dd26b579 | 5 | * @date 2018/10/01 ? |
| MasashiNomura | 45:3b51dd26b579 | 6 | */ |
| MasashiNomura | 45:3b51dd26b579 | 7 | |
| takeru0x1103 | 17:f9610f3cfa1b | 8 | #include "comFunction.h" |
| takeru0x1103 | 17:f9610f3cfa1b | 9 | //---------------------------------------- |
| takeru0x1103 | 17:f9610f3cfa1b | 10 | //文字列スプリット |
| takeru0x1103 | 17:f9610f3cfa1b | 11 | //---------------------------------------- |
| takeru0x1103 | 17:f9610f3cfa1b | 12 | std::vector<std::string> f_Split(const std::string &str, char sep) |
| takeru0x1103 | 17:f9610f3cfa1b | 13 | { |
| takeru0x1103 | 17:f9610f3cfa1b | 14 | std::vector<std::string> v; |
| takeru0x1103 | 17:f9610f3cfa1b | 15 | std::stringstream ss(str); |
| takeru0x1103 | 17:f9610f3cfa1b | 16 | std::string buffer; |
| takeru0x1103 | 17:f9610f3cfa1b | 17 | |
| takeru0x1103 | 17:f9610f3cfa1b | 18 | while( std::getline(ss, buffer, sep) ) { |
| takeru0x1103 | 17:f9610f3cfa1b | 19 | v.push_back(buffer); |
| takeru0x1103 | 17:f9610f3cfa1b | 20 | } |
| takeru0x1103 | 17:f9610f3cfa1b | 21 | return v; |
| takeru0x1103 | 17:f9610f3cfa1b | 22 | } |