1 /* 2 3 specify tag fields using pattern matching (extension) 4 5 copyright (c) 2005 squell <squell@alumina.nl> 6 7 use, modification, copying and distribution of this software is permitted 8 under the conditions described in the file 'COPYING'. 9 10 Usage: 11 12 Converts a string like "%a - %t.mp3" to "* - *.mp3" and sets field in a 13 tag accordingly to %1, %2, etc. Can be tested as a truth value to ascertain 14 whether fields have been set by this operation. 15 16 Example: 17 18 ID3 tag; 19 mass_tag(tag).glob( pattern(tag, "%n - %t.mp3") ); 20 21 */ 22 23 #ifndef __ZF_PATTERN_HPP 24 #define __ZF_PATTERN_HPP 25 26 #include <string> 27 #include "set_base.h" 28 29 class pattern : public std::string { 30 std::string str; 31 unsigned num; 32 public: 33 pattern(tag::handler& tag, std::string mask); vars()34 unsigned vars() const { return num; } 35 }; 36 37 #endif 38 39