Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  SdpParser.h

  Sprache: C
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */


#ifndef DOM_MEDIA_WEBRTC_SDP_SDPPARSER_H_
#define DOM_MEDIA_WEBRTC_SDP_SDPPARSER_H_

#include <string>
#include <vector>

#include "sdp/Sdp.h"
#include "sdp/SdpLog.h"

namespace mozilla {

class SdpParser {
 public:
  SdpParser() = default;
  virtual ~SdpParser() = default;

  class Results {
   public:
    typedef std::pair<size_t, std::string> Anomaly;
    typedef std::vector<Anomaly> AnomalyVec;
    virtual ~Results() = default;
    UniquePtr<mozilla::Sdp>& Sdp() { return mSdp; }
    const UniquePtr<mozilla::Sdp>& Sdp() const { return mSdp; }
    AnomalyVec& Errors() { return mErrors; }
    const AnomalyVec& Errors() const { return mErrors; }
    AnomalyVec& Warnings() { return mWarnings; }
    const AnomalyVec& Warnings() const { return mWarnings; }
    virtual const std::string& ParserName() const = 0;
    bool Ok() const { return mErrors.empty(); }

   protected:
    UniquePtr<mozilla::Sdp> mSdp;
    AnomalyVec mErrors;
    AnomalyVec mWarnings;
  };

  // The name of the parser implementation
  virtual const std::string& Name() const = 0;

  /**
   * This parses the provided text into an SDP object.
   * This returns a nullptr-valued pointer if things go poorly.
   */

  virtual UniquePtr<SdpParser::Results> Parse(const std::string& aText) = 0;

  class InternalResults : public Results {
   public:
    explicit InternalResults(const std::string& aParserName)
        : mParserName(aParserName) {}
    virtual ~InternalResults() = default;

    void SetSdp(UniquePtr<mozilla::Sdp>&& aSdp) { mSdp = std::move(aSdp); }

    void AddParseError(const size_t line, const std::string& message) {
      MOZ_LOG_FMT(SdpLog, LogLevel::Error, "{}: parser error {}, at line {}",
                  mParserName.c_str(), message.c_str(), line);
      mErrors.push_back(std::make_pair(line, message));
    }

    void AddParseWarning(const size_t line, const std::string& message) {
      MOZ_LOG_FMT(SdpLog, LogLevel::Warning,
                  "{}: parser warning {}, at line {}", mParserName.c_str(),
                  message.c_str(), line);
      mWarnings.push_back(std::make_pair(line, message));
    }

    const std::string& ParserName() const override { return mParserName; }

   private:
    const std::string mParserName;
  };
};

}  // namespace mozilla

#endif

Messung V0.5 in Prozent
C=93 H=98 G=95

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© 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=277311
#Domains=752002