strprintf.cpp revision f0b204548770be4884950650a101d87e35adc215
/* $Id$ */
/** @file
* innotek Portable Runtime - String Formatters.
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
/*******************************************************************************
* Structures and Typedefs *
*******************************************************************************/
/** strbufoutput() argument structure. */
typedef struct STRBUFARG
{
/** Pointer to current buffer position. */
char *psz;
/** Number of bytes left in the buffer - not including the trailing zero. */
} STRBUFARG;
/** Pointer to a strbufoutput() argument structure. */
typedef STRBUFARG *PSTRBUFARG;
/*******************************************************************************
* Internal Functions *
*******************************************************************************/
/**
* Output callback.
*
* @returns number of bytes written.
* @param pvArg Pointer to a STRBUFARG structure.
* @param pachChars Pointer to an array of utf-8 characters.
* @param cbChars Number of bytes in the character array pointed to by pachChars.
*/
{
if (cbChars)
{
}
return cbChars;
}
RTDECL(size_t) RTStrPrintfExV(PFNSTRFORMAT pfnFormat, void *pvArg, char *pszBuffer, size_t cchBuffer, const char *pszFormat, va_list args)
{
if (!cchBuffer)
{
AssertMsgFailed(("Excellent idea! Format a string with no space for the output!\n"));
return 0;
}
}
{
}
RTDECL(size_t) RTStrPrintfEx(PFNSTRFORMAT pfnFormat, void *pvArg, char *pszBuffer, size_t cchBuffer, const char *pszFormat, ...)
{
return cbRet;
}
{
return cbRet;
}