+ // Skip delimiters at beginning.
+ string::size_type last_pos = tag_string.find_first_not_of(DELIMITERS, 0);
+ // Find first "non-delimiter".
+ string::size_type pos = tag_string.find_first_of(DELIMITERS, last_pos);
+
+ while (string::npos != pos || string::npos != last_pos) {
+ string x = tag_string.substr(last_pos, pos - last_pos);
+ strip_whitespace_edges (x);
+ if (x.length()) {
+ tags.push_back (x);
+ }
+ // Skip delimiters. Note the "not_of"
+ last_pos = tag_string.find_first_not_of(DELIMITERS, pos);
+ // Find next "non-delimiter"
+ pos = tag_string.find_first_of(DELIMITERS, last_pos);
+ }
+
+ Library->set_tags (path, tags);