Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  string_builder.h

  Sprache: C
 

/*
 *  Copyright 2018 The WebRTC Project Authors. All rights reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */


#ifndef RTC_BASE_STRINGS_STRING_BUILDER_H_
#define RTC_BASE_STRINGS_STRING_BUILDER_H_

#include <cstdio>
#include <string>
#include <utility>

#include "absl/strings/has_absl_stringify.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "rtc_base/system/rtc_export.h"

namespace webrtc {

// A string builder that supports dynamic resizing while building a string.
// The class is based around an instance of std::string and allows moving
// ownership out of the class once the string has been built.
class RTC_EXPORT StringBuilder {
 public:
  StringBuilder() = default;
  explicit StringBuilder(absl::string_view s) : str_(s) {}
  StringBuilder(const StringBuilder&) = default;
  StringBuilder& operator=(const StringBuilder&) = default;

  StringBuilder& operator<<(absl::string_view str);
  StringBuilder& operator<<(char c);
  StringBuilder& operator<<(int i);
  StringBuilder& operator<<(unsigned i);
  StringBuilder& operator<<(long i);                // NOLINT
  StringBuilder& operator<<(long long i);           // NOLINT
  StringBuilder& operator<<(unsigned long i);       // NOLINT
  StringBuilder& operator<<(unsigned long long i);  // NOLINT
  StringBuilder& operator<<(float f);
  StringBuilder& operator<<(double f);

  template <typename T>
    requires absl::HasAbslStringify<T>::value
  StringBuilder& operator<<(const T& value) {
    str_ += absl::StrCat(value);
    return *this;
  }

  const std::string& str() const { return str_; }

  void Clear() { str_.clear(); }

  size_t size() const { return str_.size(); }

  // Moves out the internal std::string.
  std::string Release() { return std::move(str_); }

  // Allows appending a printf style formatted string.
  StringBuilder& AppendFormat(const char* fmt, ...)
#if defined(__GNUC__)
      __attribute__((__format__(__printf__, 23)))
#endif
      ;

 private:
  std::string str_;
};

}  //  namespace webrtc


#endif  // RTC_BASE_STRINGS_STRING_BUILDER_H_

Messung V0.5 in Prozent
C=90 H=100 G=95

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-08-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=434850
#Domains=655579