summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceValues.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt2/ResourceValues.cpp')
-rw-r--r--tools/aapt2/ResourceValues.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/aapt2/ResourceValues.cpp b/tools/aapt2/ResourceValues.cpp
index a5754e0d168f..728e35a266b7 100644
--- a/tools/aapt2/ResourceValues.cpp
+++ b/tools/aapt2/ResourceValues.cpp
@@ -22,12 +22,12 @@
#include <set>
#include <sstream>
-#include "android-base/stringprintf.h"
-#include "androidfw/ResourceTypes.h"
-
#include "Resource.h"
#include "ResourceUtils.h"
#include "ValueVisitor.h"
+#include "android-base/stringprintf.h"
+#include "androidfw/ResourceTypes.h"
+#include "io/StringStream.h"
#include "util/Util.h"
using ::aapt::text::Printer;
@@ -487,6 +487,15 @@ void BinaryPrimitive::PrettyPrint(Printer* printer) const {
}
}
+std::string BinaryPrimitive::toPrettyString() const {
+ std::string str;
+ io::StringOutputStream out(&str);
+ text::Printer printer(&out);
+ this->PrettyPrint(&printer);
+ out.Flush();
+ return str;
+}
+
Attribute::Attribute(uint32_t t)
: type_mask(t),
min_int(std::numeric_limits<int32_t>::min()),