]>
git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_codesigning/antlr2/src/String.cpp
1 /* ANTLR Translator Generator
2 * Project led by Terence Parr at http://www.jGuru.com
3 * Software rights: http://www.antlr.org/license.html
5 * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/src/String.cpp#2 $
8 #include "antlr/String.hpp"
12 #ifdef HAS_NOT_CSTDIO_H
18 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
22 // wh: hack for Borland C++ 5.6
28 // RK: should be using snprintf actually... (or stringstream)
29 ANTLR_C_USING(sprintf
)
31 ANTLR_USE_NAMESPACE(std
)string
operator+( const ANTLR_USE_NAMESPACE(std
)string
& lhs
, const int rhs
)
34 sprintf(tmp
,"%d",rhs
);
38 ANTLR_USE_NAMESPACE(std
)string
operator+( const ANTLR_USE_NAMESPACE(std
)string
& lhs
, size_t rhs
)
41 sprintf(tmp
,"%lu",(unsigned long)rhs
);
45 /** Convert character to readable string
47 ANTLR_USE_NAMESPACE(std
)string
charName(int ch
)
53 ANTLR_USE_NAMESPACE(std
)string s
;
55 // when you think you've seen it all.. an isprint that crashes...
57 #ifdef ANTLR_CCTYPE_NEEDS_STD
58 if( ANTLR_USE_NAMESPACE(std
)isprint( ch
) )
72 unsigned int t
= ch
>> 4;
87 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE