本文整理汇总了C++中U_TRACE函数的典型用法代码示例。如果您正苦于以下问题:C++ U_TRACE函数的具体用法?C++ U_TRACE怎么用?C++ U_TRACE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了U_TRACE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: U_TRACE
bool UDynamic::load(const char* pathname)
{
U_TRACE(0, "UDynamic::load(%S)", pathname)
U_CHECK_MEMORY
U_INTERNAL_ASSERT_EQUALS(handle, 0)
#ifdef _MSWINDOWS_
handle = ::LoadLibrary(pathname);
#else
/**
* Perform lazy binding
* --------------------------------------------------------------------
* Only resolve symbols as the code that references them is executed.
* If the symbol is never referenced, then it is never resolved.
* Lazy binding is only performed for function references; references
* to variables are always immediately bound when the library is loaded
* --------------------------------------------------------------------
*/
handle = U_SYSCALL(dlopen, "%S,%d", pathname, RTLD_LAZY); // RTLD_NOW
#endif
if (handle == 0)
{
# if defined(_MSWINDOWS_)
err = "load failed";
# else
err = ::dlerror();
# endif
U_WARNING("UDynamic::load(%S) failed: %.*S", pathname, 256, err);
U_RETURN(false);
}
#ifndef _MSWINDOWS_
(void) ::dlerror(); /* Clear any existing error */
#endif
U_RETURN(true);
}
示例2: U_TRACE
void UPosting::reset()
{
U_TRACE(5, "UPosting::reset()")
max_distance = 2;
sub_word_pos_prev = 0;
if (vec_sub_word) resetVectorCompositeWord();
if (vec_word)
{
delete vec_word;
delete vec_entry;
delete vec_posting;
vec_word = 0;
vec_entry = 0;
vec_posting = 0;
}
}
示例3: check_content
static void check_content(const UString& content, const UString& filename)
{
U_TRACE(5, "check_content(%p,%p)", content.data(), filename.data())
UString dati = UFile::contentOf(filename);
if (dati != content)
{
UFile save_file;
if (save_file.creat(U_STRING_FROM_CONSTANT("tmp/content.different")))
{
save_file.write(content);
save_file.close();
}
}
U_ASSERT( dati == content )
}
示例4: getOptionValue
UString getOptionValue(const char* param, const char* tag)
{
U_TRACE(5, "Application::getOptionValue(%S,%S)", param, tag)
UString result;
if (param && *param) result = param;
else
{
UString tmp(100U);
U_INTERNAL_DUMP("xades_c = %b", xades_c)
tmp.snprintf(U_CONSTANT_TO_PARAM("XAdES-%s.%s"), (xades_c ? "C" : "BES"), tag);
result = cfg[tmp];
}
U_RETURN_STRING(result);
}
示例5: U_TRACE
void HttpBaWwwAuthenticate::stringify(UString& field)
{
U_TRACE(5, "HttpBaWwwAuthenticate::stringify(%.*S)", U_STRING_TO_TRACE(field))
field += name;
field.append(U_CONSTANT_TO_PARAM(": Basic realm="));
bool quoted = (realm[0] == '"');
if (quoted == false) field += '"';
field += realm;
if (quoted == false) field += '"';
field.append(U_CONSTANT_TO_PARAM("\r\n"));
U_INTERNAL_DUMP("field = %.*S", U_STRING_TO_TRACE(field))
}
示例6: U_TRACE
UString UPKCS10::getSubject(X509_REQ* _request)
{
U_TRACE(1, "UPKCS10::getSubject(%p)", _request)
U_INTERNAL_ASSERT_POINTER(_request)
X509_NAME* name = X509_REQ_get_subject_name(_request);
unsigned len = U_SYSCALL(i2d_X509_NAME, "%p,%p", name, 0);
UString subject(len);
char* ptr = subject.data();
(void) U_SYSCALL(X509_NAME_oneline, "%p,%p,%d", name, ptr, subject.capacity());
len = u__strlen(ptr, __PRETTY_FUNCTION__);
subject.size_adjust(len);
U_RETURN_STRING(subject);
}
示例7: main
int main(int argc, char *argv[])
{
U_ULIB_INIT(argv);
U_TRACE(5,"main(%d)",argc)
UTwilioClient tc(U_STRING_FROM_CONSTANT("SID"), U_STRING_FROM_CONSTANT("TOKEN"));
bool ok = tc.getCompletedCalls();
U_INTERNAL_ASSERT(ok)
ok = tc.makeCall(U_CONSTANT_TO_PARAM("xxx-xxx-xxxx"), U_CONSTANT_TO_PARAM("xxx-xxx-xxxx"), U_CONSTANT_TO_PARAM("http://xxxx"));
U_INTERNAL_ASSERT(ok)
ok = tc.sendSMS(U_CONSTANT_TO_PARAM("xxx-xxx-xxxx"), U_CONSTANT_TO_PARAM("xxx-xxx-xxxx"), U_CONSTANT_TO_PARAM("\"Hello, how are you?\""));
U_INTERNAL_ASSERT(ok)
}
示例8: U_TRACE
void UTree<void*>::callForAllEntry(vPFpvpv function)
{
U_TRACE(0, "UTree<void*>::callForAllEntry(%p)", function)
U_CHECK_MEMORY
UTree<void*>* p;
if (_elem) function((void*)_elem, this);
if (UVector<void*>::empty() == false)
{
for (const void** ptr = vec; ptr < (vec + _length); ++ptr)
{
p = (UTree<void*>*)(*ptr);
p->callForAllEntry(function);
}
}
}
示例9: U_TRACE
bool UBase64::decodeAll(const char* s, uint32_t n, UString& buffer)
{
U_TRACE(0, "UBase64::decodeAll(%.*S,%u,%.*S)", n, s, n, U_STRING_TO_TRACE(buffer))
uint32_t pos = u_base64all_decode(s, n, (unsigned char*)buffer.data());
buffer.size_adjust(pos);
U_INTERNAL_DUMP("u_base64_errors = %u buffer(%u) = %#.*S", u_base64_errors, buffer.size(), U_STRING_TO_TRACE(buffer))
if (pos > 0 &&
u_base64_errors == 0)
{
U_RETURN(true);
}
U_INTERNAL_DUMP("buffer(%u) = %#.*S", buffer.size(), U_STRING_TO_TRACE(buffer))
U_RETURN(false);
}
示例10: main
int
U_EXPORT main (int argc, char* argv[])
{
U_ULIB_INIT(argv);
U_TRACE(5,"main(%d)",argc)
U_ASSERT_EQUALS( UServices::dosMatchWithOR(U_CONSTANT_TO_PARAM("www.sito1.com"), U_CONSTANT_TO_PARAM("SSI|benchmark|www.sito1.com|www.sito2.com"), FNM_INVERT), false)
UString buffer(2000);
u_base64_max_columns = 72;
UBase64::encode(U_CONSTANT_TO_PARAM(TESTOA), buffer);
U_INTERNAL_DUMP("buffer = %#.*S", U_STRING_TO_TRACE(buffer))
U_ASSERT( buffer == U_STRING_FROM_CONSTANT(TESTOB) )
UBase64::decode( U_CONSTANT_TO_PARAM(TESTOB), buffer);
U_ASSERT( buffer == U_STRING_FROM_CONSTANT(TESTOA) )
UString cmd, result1, result2;
int fd_stderr = U_SYSCALL(open, "%S,%d", "err/services.err", O_WRONLY);
cmd = U_STRING_FROM_CONSTANT("ls test_services.cpp");
result1 = UCommand::outputCommand(cmd);
// U_ASSERT( result1 == U_STRING_FROM_CONSTANT("test_services.cpp\n") )
buffer = UServices::getUUID();
U_INTERNAL_DUMP("buffer = %#.*S", U_STRING_TO_TRACE(buffer))
cmd = U_STRING_FROM_CONSTANT("cat test_services.cpp");
result2 = UCommand::outputCommand(cmd, 0, -1, fd_stderr);
U_ASSERT( result2.empty() == false )
cout.write(result2.data(), result2.size());
}
示例11: U_TRACE
bool UREDISClient_Base::connect(const char* phost, unsigned int _port)
{
U_TRACE(0, "UREDISClient_Base::connect(%S,%u)", phost, _port)
UString host;
if (phost) (void) host.assign(phost);
else
{
const char* env_redis_host = (const char*) U_SYSCALL(getenv, "%S", "REDIS_HOST");
const char* env_redis_port = (const char*) U_SYSCALL(getenv, "%S", "REDIS_PORT");
if (env_redis_port) _port = atoi(env_redis_port);
uint32_t env_redis_host_len = (env_redis_host ? u__strlen(env_redis_host, __PRETTY_FUNCTION__) : 0);
if (env_redis_host_len) (void) host.assign(env_redis_host, env_redis_host_len);
else host = *UString::str_localhost;
}
if (UClient_Base::setHostPort(host, _port) && UClient_Base::connect())
{
UClient_Base::iovcnt = 4;
UClient_Base::iov[1].iov_base =
UClient_Base::iov[4].iov_base = (caddr_t)" ";
UClient_Base::iov[1].iov_len =
UClient_Base::iov[4].iov_len = 1;
UClient_Base::iov[3].iov_base =
UClient_Base::iov[5].iov_base = (caddr_t)U_CRLF;
UClient_Base::iov[3].iov_len =
UClient_Base::iov[5].iov_len = 2;
U_DUMP("getRedisVersion() = %V", getRedisVersion().rep)
U_RETURN(true);
}
U_RETURN(false);
}
示例12: U_TRACE
bool UTranformXPointer::setExpr(const char* expr, int nodeSetType, xmlNodePtr node)
{
U_TRACE(0, "UTranformXPointer::setExpr(%S,%d,%p)", expr, nodeSetType, node)
UBaseTransform::hereNode = node;
UXPathData* data;
U_NEW(UXPathData, data, UXPathData(UXPathData::XPOINTER, nodeSetType, expr));
if (data->registerNamespaces(node))
{
dataList.push(data);
U_RETURN(true);
}
U_DELETE(data)
U_RETURN(false);
}
示例13: U_TRACE
UString URPCObject::processMessage(URPCEnvelope& envelope, bool& bContainsFault)
{
U_TRACE(0, "URPCObject::processMessage(%p,%p)", &envelope, &bContainsFault)
U_INTERNAL_ASSERT_POINTER(URPCMethod::encoder)
UString retval;
// Iterate over the list of methods
URPCMethod* method = find(envelope.getMethodName());
if (method == 0)
{
// Return object not found error. This would be a Client fault
setFailed();
URPCMethod::pFault->setFaultReason(U_CONSTANT_TO_PARAM("The requested method does not exist on this server"));
bContainsFault = true;
retval = URPCMethod::encoder->encodeFault(URPCMethod::pFault);
}
else
{
UString ns = envelope.getNsName();
U_INTERNAL_DUMP("envelope.nsName = %V", ns.rep)
// check the name of namespace qualified element information (gSOAP)
if (ns.empty()) ns = method->getNamespaces();
if (ns.empty()) ns = *UString::str_ns;
bContainsFault = (method->execute(envelope) == false);
retval = URPCMethod::encoder->encodeMethodResponse(*method, ns);
}
U_RETURN_STRING(retval);
}
示例14: U_TRACE
uint32_t UXML2Document::getElement(UVector<UString>& velement, const char* tag, uint32_t tag_len)
{
U_TRACE(0, "UXML2Document::getElement(%p,%.*S,%u)", &velement, tag_len, tag, tag_len)
U_INTERNAL_ASSERT_POINTER(tag)
UString element;
uint32_t n = velement.size(), pos = 0;
while (true)
{
pos = getElement(element, pos, tag, tag_len);
if (pos == U_NOT_FOUND) break;
velement.push(element);
}
uint32_t result = velement.size() - n;
U_RETURN(result);
}
示例15: U_TRACE
U_EXPORT ostream& operator<<(ostream& os, const UXMLAttribute& a)
{
U_TRACE(0+256, "UXMLAttribute::operator<<(%p,%p)", &os, &a)
os.put('{');
os.put(' ');
if (a.namespaceName)
{
os << a.namespaceName;
os.put(':');
}
os << a.accessor;
os.put('=');
os << a.value;
os.put(' ');
os.put('}');
return os;
}