Преглед изворни кода

multifile: Return vector_uchar from readSubfile

        - Return vector_uchar from readSubfile instead of
        string. This will correct problems with Python 3 unicode
        strings and will return bytes instead.

Signed-off-by: deflected <[email protected]>

Closes #290
deflected пре 7 година
родитељ
комит
09a9a8ff22
2 измењених фајлова са 5 додато и 4 уклоњено
  1. 3 3
      panda/src/express/multifile.I
  2. 2 1
      panda/src/express/multifile.h

+ 3 - 3
panda/src/express/multifile.I

@@ -278,12 +278,12 @@ remove_subfile(const string &subfile_name) {
 }
 
 /**
- * Returns a string that contains the entire contents of the indicated
+ * Returns a vector_uchar that contains the entire contents of the indicated
  * subfile.
  */
-INLINE string Multifile::
+INLINE vector_uchar Multifile::
 read_subfile(int index) {
-  string result;
+  vector_uchar result;
   read_subfile(index, result);
   return result;
 }

+ 2 - 1
panda/src/express/multifile.h

@@ -24,6 +24,7 @@
 #include "indirectLess.h"
 #include "referenceCount.h"
 #include "pvector.h"
+#include "vector_uchar.h"
 
 #ifdef HAVE_OPENSSL
 typedef struct x509_st X509;
@@ -125,7 +126,7 @@ PUBLISHED:
   streampos get_subfile_internal_start(int index) const;
   size_t get_subfile_internal_length(int index) const;
 
-  BLOCKING INLINE string read_subfile(int index);
+  BLOCKING INLINE vector_uchar read_subfile(int index);
   BLOCKING istream *open_read_subfile(int index);
   BLOCKING static void close_read_subfile(istream *stream);
   BLOCKING bool extract_subfile(int index, const Filename &filename);