1/* 2// Copyright (c) 2014 Intel Corporation 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15*/ 16#include <stdarg.h> 17#include <stdio.h> 18 19#include <Dump.h> 20 21namespace android { 22namespace intel { 23 24Dump::Dump(char *buf, int len) 25 : mBuf(buf), 26 mLen(len) 27{ 28 29} 30 31Dump::~Dump() 32{ 33 34} 35 36void Dump::append(const char *fmt, ...) 37{ 38 int len; 39 40 if (!mBuf || !mLen) 41 return; 42 43 va_list ap; 44 va_start(ap, fmt); 45 len = vsnprintf(mBuf, mLen, fmt, ap); 46 va_end(ap); 47 48 mLen -= len; 49 mBuf += len; 50} 51 52} // namespace intel 53} // namespace android 54