]> granicus.if.org Git - taglib/commitdiff
Convert from ByteVectorList to StringList
authorAllan Sandfeld Jensen <kde@carewolf.com>
Mon, 23 Aug 2004 15:26:23 +0000 (15:26 +0000)
committerAllan Sandfeld Jensen <kde@carewolf.com>
Mon, 23 Aug 2004 15:26:23 +0000 (15:26 +0000)
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@340107 283d02a7-25f6-0310-bc7c-ecb5cbfe19da

toolkit/tstringlist.cpp
toolkit/tstringlist.h

index f03684f8a5f9b88f6741b984bfceb67bc5b324a1..f37b30bf81caaab2fe8adf1d06dd59ecc6184dbc 100644 (file)
@@ -66,6 +66,14 @@ StringList::StringList(const String &s) : List<String>()
   append(s);
 }
 
+StringList::StringList(const ByteVectorList &bl, String::Type t) : List<String>()
+{
+  ByteVectorList::ConstIterator i = bl.begin();
+  for(;i != bl.end(); i++) {
+    append(String(*i, t));
+  }
+}
+
 StringList::~StringList()
 {
 
index 33dec4b710f1684d6b8012fd0ec2ad0ef89a102e..5a2219e214b97e780a336a4db3e21c4036092b08 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "tstring.h"
 #include "tlist.h"
+#include "tbytevectorlist.h"
 
 #include <iostream>
 
@@ -57,6 +58,14 @@ namespace TagLib {
      */
     StringList(const String &s);
 
+    /*!
+     * Makes a deep copy of the data in \a vl.
+     *
+     * \note This should only be used with the 8-bit codecs Latin1 and UTF8, when
+     * used with other codecs it will simply print a warning and exit.
+     */
+    StringList(const ByteVectorList &vl, String::Type t = String::Latin1);
+
     /*!
      * Destroys this StringList instance.
      */