<commit_before>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/chromeos/bluetooth/bluetooth_service_record.h"

#include <string>
#include <vector>

#include "base/logging.h"
#include "base/string_number_conversions.h"
#include "chrome/common/libxml_utils.h"

namespace {

static const char* kAttributeNode = "attribute";
static const char* kIdAttribute = "id";
static const char* kProtocolDescriptorListId = "0x0004";
static const char* kRfcommUuid = "0x0003";
static const char* kSdpNameId = "0x0100";
static const char* kSequenceNode = "sequence";
static const char* kTextNode = "text";
static const char* kUint8Node = "uint8";
static const char* kUuidNode = "uuid";
static const char* kValueAttribute = "value";

bool AdvanceToTag(XmlReader* reader, const char* node_type) {
  do {
    if (!reader->Read())
      return false;
  } while (reader->NodeName() != node_type);
  return true;
}

bool ExtractTextValue(XmlReader* reader, std::string* value_out) {
  if (AdvanceToTag(reader, kTextNode)) {
    reader->NodeAttribute(kValueAttribute, value_out);
    return true;
  }
  return false;
}<commit_msg>Missed a file in crrev.com/137247 (Moving libxml_utils). Fixing Chrome ChromeOS bot.<commit_after>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/chromeos/bluetooth/bluetooth_service_record.h"

#include <string>
#include <vector>

#include "base/logging.h"
#include "base/string_number_conversions.h"
#include "third_party/libxml/chromium/libxml_utils.h"

namespace {

static const char* kAttributeNode = "attribute";
static const char* kIdAttribute = "id";
static const char* kProtocolDescriptorListId = "0x0004";
static const char* kRfcommUuid = "0x0003";
static const char* kSdpNameId = "0x0100";
static const char* kSequenceNode = "sequence";
static const char* kTextNode = "text";
static const char* kUint8Node = "uint8";
static const char* kUuidNode = "uuid";
static const char* kValueAttribute = "value";

bool AdvanceToTag(XmlReader* reader, const char* node_type) {
  do {
    if (!reader->Read())
      return false;
  } while (reader->NodeName() != node_type);
  return true;
}

bool ExtractTextValue(XmlReader* reader, std::string* value_out) {
  if (AdvanceToTag(reader, kTextNode)) {
    reader->NodeAttribute(kValueAttribute, value_out);
    return true;
  }
  return false;
}
{'fraction_non_alphanumeric': 0.11617136240833655, 'fraction_numerical': 0.018525665766113468, 'mean_word_length': 5.084507042253521, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '136391', 'n_tokens_mistral': 857, 'n_tokens_neox': 817, 'n_words': 254}