diff options
Diffstat (limited to 'include/pdf/SkPDFTypes.h')
-rw-r--r-- | include/pdf/SkPDFTypes.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/pdf/SkPDFTypes.h b/include/pdf/SkPDFTypes.h index a281628a23..fc9b62c30a 100644 --- a/include/pdf/SkPDFTypes.h +++ b/include/pdf/SkPDFTypes.h @@ -21,6 +21,7 @@ #include "SkScalar.h" #include "SkString.h" #include "SkTDArray.h" +#include "SkTypes.h" class SkPDFCatalog; class SkWStream; @@ -169,6 +170,14 @@ public: */ explicit SkPDFString(const char value[]); explicit SkPDFString(const SkString& value); + + /** Create a PDF string. Maximum length (in bytes) is 65,535. + * @param value A string value. + * @param len The length of value. + * @param wideChars Indicates if the top byte in value is significant and + * should be encoded (true) or not (false). + */ + SkPDFString(const uint16_t* value, size_t len, bool wideChars); virtual ~SkPDFString(); // The SkPDFObject interface. @@ -176,12 +185,16 @@ public: bool indirect); virtual size_t getOutputSize(SkPDFCatalog* catalog, bool indirect); + static SkString formatString(const char* input, size_t len); + static SkString formatString(const uint16_t* input, size_t len, + bool wideChars); private: static const size_t kMaxLen = 65535; const SkString fValue; - SkString formatString(const SkString& input); + static SkString doFormatString(const void* input, size_t len, + bool wideInput, bool wideOutput); }; /** \class SkPDFName |