+
+ return Column;
+}
+
+/// ComputeColumn - Examine the current output and figure out which
+/// column we end up in after output.
+void formatted_raw_ostream::ComputeColumn(const char *Ptr, size_t Size) {
+ // If our previous scan pointer is inside the buffer, assume we already
+ // scanned those bytes. This depends on raw_ostream to not change our buffer
+ // in unexpected ways.
+ if (Ptr <= Scanned && Scanned <= Ptr + Size) {
+ // Scan all characters added since our last scan to determine the new
+ // column.
+ ColumnScanned = CountColumns(ColumnScanned, Scanned,
+ Size - (Scanned - Ptr));
+ } else
+ ColumnScanned = CountColumns(ColumnScanned, Ptr, Size);
+
+ // Update the scanning pointer.
+ Scanned = Ptr + Size;