#include "base/strings/utf_offset_string_conversions.h"
#include <stdint.h>
#include <algorithm>
#include <memory>
#include <string_view>
#include "base/check_op.h"
#include "base/strings/utf_string_conversion_utils.h"
namespace base {
OffsetAdjuster::Adjustment::Adjustment(size_t original_offset,
size_t original_length,
size_t output_length)
: … { … }
void OffsetAdjuster::AdjustOffsets(const Adjustments& adjustments,
std::vector<size_t>* offsets_for_adjustment,
size_t limit) { … }
void OffsetAdjuster::AdjustOffset(const Adjustments& adjustments,
size_t* offset,
size_t limit) { … }
void OffsetAdjuster::UnadjustOffsets(
const Adjustments& adjustments,
std::vector<size_t>* offsets_for_unadjustment) { … }
void OffsetAdjuster::UnadjustOffset(const Adjustments& adjustments,
size_t* offset) { … }
void OffsetAdjuster::MergeSequentialAdjustments(
const Adjustments& first_adjustments,
Adjustments* adjustments_on_adjusted_string) { … }
template<typename SrcChar, typename DestStdString>
bool ConvertUnicode(const SrcChar* src,
size_t src_len,
DestStdString* output,
OffsetAdjuster::Adjustments* adjustments) { … }
bool UTF8ToUTF16WithAdjustments(
const char* src,
size_t src_len,
std::u16string* output,
base::OffsetAdjuster::Adjustments* adjustments) { … }
std::u16string UTF8ToUTF16WithAdjustments(
std::string_view utf8,
base::OffsetAdjuster::Adjustments* adjustments) { … }
std::u16string UTF8ToUTF16AndAdjustOffsets(
std::string_view utf8,
std::vector<size_t>* offsets_for_adjustment) { … }
std::string UTF16ToUTF8AndAdjustOffsets(
std::u16string_view utf16,
std::vector<size_t>* offsets_for_adjustment) { … }
}