oculus1

diff libovr/Src/Kernel/OVR_String_FormatUtil.cpp @ 1:e2f9e4603129

added LibOVR and started a simple vr wrapper.
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 14 Sep 2013 16:14:59 +0300
parents
children b069a5c27388
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libovr/Src/Kernel/OVR_String_FormatUtil.cpp	Sat Sep 14 16:14:59 2013 +0300
     1.3 @@ -0,0 +1,1 @@
     1.4 +/************************************************************************************
     1.5 
     1.6 Filename    :   OVR_String_FormatUtil.cpp
     1.7 Content     :   String format functions.
     1.8 Created     :   February 27, 2013
     1.9 Notes       : 
    1.10 
    1.11 Copyright   :   Copyright 2013 Oculus VR, Inc. All Rights reserved.
    1.12 
    1.13 Use of this software is subject to the terms of the Oculus license
    1.14 agreement provided at the time of installation or download, or which
    1.15 otherwise accompanies this software in either electronic or hard copy form.
    1.16 
    1.17 ************************************************************************************/
    1.18 
    1.19 #include "OVR_String.h"
    1.20 #include "OVR_Log.h"
    1.21 
    1.22 namespace OVR {
    1.23 
    1.24 void StringBuffer::AppendFormat(const char* format, ...)
    1.25 {       
    1.26     va_list argList;
    1.27 
    1.28     va_start(argList, format);
    1.29     UPInt size = OVR_vscprintf(format, argList);
    1.30     va_end(argList);
    1.31 
    1.32     char* buffer = (char*) OVR_ALLOC(sizeof(char) * (size+1));
    1.33 
    1.34     va_start(argList, format);
    1.35     UPInt result = OVR_vsprintf(buffer, size+1, format, argList);
    1.36     OVR_UNUSED1(result);
    1.37     va_end(argList);
    1.38     OVR_ASSERT_LOG(result == size, ("Error in OVR_vsprintf"));
    1.39 
    1.40     AppendString(buffer);
    1.41 
    1.42     OVR_FREE(buffer);
    1.43 }
    1.44 
    1.45 } // OVR
    1.46 \ No newline at end of file