私が取得したこのコードを実行しながら、ページからすべてのリンクを回復したい:
Microsoft Visual C++ デバッグ ライブラリ
デバッグ アサーションに失敗しました!
プログラム: C:\Users\Gandalf\Desktop\proxy\Debug\Proxy.exe ファイル: C:\Program Files\Microsoft Visual Studio 10.0\VC\include\xstring 行: 78
式: 文字列反復子は逆参照できません
プログラムがどのようにアサーション エラーを引き起こすかについては、アサートに関する Visual C++ のドキュメントを参照してください。
(アプリケーションをデバッグするには、[再試行] を押します)
中止 再試行 無視
void Deltacore::Client::get_links() {
boost::smatch matches;
boost::match_flag_type flags = boost::match_default;
boost::regex URL_REGEX("^<a[^>]*(http://[^\"]*)[^>]*>([ 0-9a-zA-Z]+)</a>$");
if(!response.empty()) {
std::string::const_iterator alfa = this->response.begin();
std::string::const_iterator omega = this->response.end();
while (boost::regex_search(alfa, omega, matches, URL_REGEX))
{
std::cout << matches[0];
//if(std::find(this->Links.begin(), this->Links.end(), matches[0]) != this->Links.end()) {
this->Links.push_back(matches[0]);
//}
alfa = matches[0].second;
}
}
}
何かアイデアはありますか?
さらにコードを追加しました:
Deltacore::Client client;
client.get_url(target);
client.get_links();
boost::property_tree::ptree props;
for(size_t i = 0; i < client.Links.size(); i++)
props.push_back(std::make_pair(boost::lexical_cast<std::string>(i), client.Links.at(i)));
std::stringstream ss;
boost::property_tree::write_json(ss, props, false);
boost::asio::async_write(socket_,
boost::asio::buffer(ss.str(), ss.str().length()),
boost::bind(&session::handle_write, this,
boost::asio::placeholders::error));
前もって感謝します