Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bcf08569 authored by Lajos Molnar's avatar Lajos Molnar
Browse files

stagefright: add AString constructor from String8

Change-Id: I85b37b6dee4ea9d5f7f1c1a40ff405a01a0c67f1
parent cffcba56
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -22,10 +22,13 @@

namespace android {

struct String8;

struct AString {
    AString();
    AString(const char *s);
    AString(const char *s, size_t size);
    AString(const String8 &from);
    AString(const AString &from);
    AString(const AString &from, size_t offset, size_t n);
    ~AString();
+8 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <string.h>

#include <utils/String8.h>
#include "ADebug.h"
#include "AString.h"

@@ -48,6 +49,13 @@ AString::AString(const char *s, size_t size)
    setTo(s, size);
}

AString::AString(const String8 &from)
    : mData(NULL),
      mSize(0),
      mAllocSize(1) {
    setTo(from.string(), from.length());
}

AString::AString(const AString &from)
    : mData(NULL),
      mSize(0),