HTML File Utility
You''ll want to extract the string following "mailto", use find to locate the start of that string (ie it begins immediately after ''mailto:'') and it ends most likely with a ''"'' double quote.
Again, I''m more of a C coder, so I can''t say specificially, but it looks to me that "buffer.find( buffer, out_buf, "mailto:" );" will search for "mailto:" and put that into the buffer rather than the address following it. You''ll have to read the docs and go from there.
Using C, I would check the line for ''mailto;'' using the strstr function. If the returned value isn''t null, then I know the line contains the string and the return value is a pointer to the beginning of ''mailto:''. I would then advance the pointer by 7 to skip over ''mailto:'' and then store/write the following values from the line until I encountered a closing ''"''. And then loop until eof.
Using C, I would check the line for ''mailto;'' using the strstr function. If the returned value isn''t null, then I know the line contains the string and the return value is a pointer to the beginning of ''mailto:''. I would then advance the pointer by 7 to skip over ''mailto:'' and then store/write the following values from the line until I encountered a closing ''"''. And then loop until eof.
std::string::find_first_of() will find the first occurence of a given character or set of characters - such as a colon in your case. It returns the integer offset into the string, so use that plus one and std::string::substr() to extract the desired address. See the STL link in either my or Kylotan''s signatures (it''s the same) for documentation on the Standard Template Library.
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement