C++, boost: which is fastest way to parse string like tcp://adr:port/ into address string and one int for port?

后端 未结 5 2287
南旧
南旧 2020-12-22 01:31

we have std::string A with tcp://adr:port/ How to parse it into address std::string and one int for port?

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-22 02:26

    Fastest as in computer time or programmer time? I can't speak of benchmarks but the uri library in the cpp-netlib framework works very well and is very easy and straightforward to use.

    http://cpp-netlib.github.com/0.8-beta/uri.html

提交回复
热议问题