本文整理汇总了C++中PString类的典型用法代码示例。如果您正苦于以下问题:C++ PString类的具体用法?C++ PString怎么用?C++ PString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetModTypeString
PString SoundFX::GetModTypeString(int32 index)
{
PString type;
type.LoadString(res, IDS_SFX_MIME);
return (type);
}
示例2: GetDescription
PString SoundFX::GetDescription(int32 index)
{
PString description;
description.LoadString(res, IDS_SFX_DESCRIPTION);
return (description);
}
示例3: NPVARIANT_TO_STRING
bool
ScriptablePluginObject::Invoke(NPIdentifier name, const NPVariant *args,
uint32_t argCount, NPVariant *result)
{
if (name == sendCmd_id)
{
if ( argCount < 1 )
{
return false;
}
PString strParam = "";
NPString npStr = NPVARIANT_TO_STRING( args[0] );
for (unsigned int i=0; i<npStr.utf8length; i++)
{
strParam += npStr.utf8characters[ i ];
}
PString strResult = g_NativeLogic.InvokeFunction( strParam );
char* pszName = (char*)NPN_MemAlloc( strResult.GetSize() + 1 );
strcpy( pszName, strResult );
STRINGZ_TO_NPVARIANT(pszName, *result);
return PR_TRUE;
}
return PR_FALSE;
}
示例4: pPathGetApplicationDirectory
pbool PIni::load(const pchar *filename)
{
//
// Look for the file in the specified path
//
const pchar* pathList[] =
{
".",
pPathGetApplicationDirectory(),
pPathGetExternalStoragePath(),
};
for (size_t i = 0; i < sizeof(pathList) / sizeof(pathList[0]); ++i)
{
if (pathList[i] != P_NULL)
{
PString cfgPath = PString(pathList[i]) + PString(pPathGetDelimiter()) + PString(filename);
PFile *fp = pfopen(cfgPath.c_str(), "rb");
if (fp != P_NULL)
{
if (ini_parse_file((FILE *)(fp), iniHandler_internal, this) < 0)
{
PLOG_ERROR("Failed to parse %s", cfgPath.c_str());
pfclose(fp);
return false;
}
pfclose(fp);
return true;
}
}
}
//
// Look for the ini file in asset
//
PAsset asset = pAssetOpen(filename);
if (pAssetIsValid(&asset))
{
PIniBufferObject iniBufferObject;
iniBufferObject.m_buffer = (const pchar*)pAssetGetBuffer(&asset);
iniBufferObject.m_bufferSize = pAssetGetSize(&asset);
iniBufferObject.m_position = 0;
if (ini_parse_buffer(&iniBufferObject, iniHandler_internal, this) < 0)
{
PLOG_ERROR("Failed to parse %s", filename);
pAssetClose(&asset);
return false;
}
pAssetClose(&asset);
return true;
}
PLOG_ERROR("Failed to find %s", filename);
return false;
}
示例5: GetDescription
PString JamCracker::GetDescription(int32 index)
{
PString description;
description.LoadString(res, IDS_JAM_DESCRIPTION);
return (description);
}
示例6: GetName
PString DecruncherAgent::GetName(int32 index)
{
PString name;
name.LoadString(res, IDS_DECRUNCH_NAME);
return (name);
}
示例7: GetName
PString JamCracker::GetName(int32 index)
{
PString name;
name.LoadString(res, IDS_JAM_NAME);
return (name);
}
示例8: GetDescription
PString DecruncherAgent::GetDescription(int32 index)
{
PString description;
description.LoadString(res, IDS_DECRUNCH_DESCRIPTION);
return (description);
}
示例9: m
bool Opal::Sip::EndPoint::OnReceivedMESSAGE (OpalTransport & transport,
SIP_PDU & pdu)
{
PString *last = NULL;
PString *val = NULL;
PString from = pdu.GetMIME().GetFrom();
PINDEX j = from.Find (';');
if (j != P_MAX_INDEX)
from = from.Left(j); // Remove all parameters
j = from.Find ('<');
if (j != P_MAX_INDEX && from.Find ('>') == P_MAX_INDEX)
from += '>';
PWaitAndSignal m(msgDataMutex);
last = msgData.GetAt (SIPURL (from).AsString ());
if (!last || *last != pdu.GetMIME ().GetFrom ()) {
val = new PString (pdu.GetMIME ().GetFrom ());
msgData.SetAt (SIPURL (from).AsString (), val);
SIPURL uri = from;
uri.Sanitise (SIPURL::RequestURI);
std::string display_name = (const char *) uri.GetDisplayName ();
std::string message_uri = (const char *) uri.AsString ();
std::string _message = (const char *) pdu.GetEntityBody ();
runtime.run_in_main (sigc::bind (sigc::ptr_fun (push_message_in_main), dialect, message_uri, display_name, _message));
}
return SIPEndPoint::OnReceivedMESSAGE (transport, pdu);
}
示例10: GetDescription
PString MediaKitAgent::GetDescription(int32 index)
{
PString description;
description.LoadString(res, IDS_MEDIAKIT_DESCRIPTION);
return (description);
}
示例11: GetModTypeString
PString JamCracker::GetModTypeString(int32 index)
{
PString type;
type.LoadString(res, IDS_JAM_MIME);
return (type);
}
示例12: GetName
PString SoundFX::GetName(int32 index)
{
PString name;
name.LoadString(res, IDS_SFX_NAME);
return (name);
}
示例13: OnReceivedMESSAGE
bool
Opal::Sip::EndPoint::OnReceivedMESSAGE (OpalTransport & transport,
SIP_PDU & pdu)
{
if (pdu.GetMIME().GetContentType(false) != "text/plain")
return false; // Ignore what we do not handle.
PString from = pdu.GetMIME().GetFrom();
PINDEX j = from.Find (';');
if (j != P_MAX_INDEX)
from = from.Left(j); // Remove all parameters
j = from.Find ('<');
if (j != P_MAX_INDEX && from.Find ('>') == P_MAX_INDEX)
from += '>';
SIPURL uri = from;
uri.Sanitise (SIPURL::RequestURI);
std::string display_name = (const char *) uri.GetDisplayName ();
std::string message_uri = (const char *) uri.AsString ();
std::string _message = (const char *) pdu.GetEntityBody ();
Ekiga::Runtime::run_in_main (boost::bind (&Opal::Sip::EndPoint::push_message_in_main, this, message_uri, display_name, _message));
return SIPEndPoint::OnReceivedMESSAGE (transport, pdu);
}
示例14: messenger
PString APServerCommunication::SendCommand(void *handle, PString command)
{
BMessenger messenger(NULL, serverLooper);
BMessage message(APSERVER_MSG_DATA);
BMessage reply;
const char *replyCmd;
char *cmdStr;
// Just add the looper and command to the message
message.AddPointer("ClientLooper", handle);
message.AddString("Command", (cmdStr = command.GetString()));
command.FreeBuffer(cmdStr);
// Send the command and wait for the reply
messenger.SendMessage(&message, &reply);
if (reply.what != APSERVER_MSG_OK)
{
// The server couldn't understand or run the command
//
// Find the error string
if (reply.FindString("Result", &replyCmd) == B_OK)
return (PString("ERR=") + replyCmd);
return ("ERR=0");
}
// Extract the answer from the reply message
if (reply.FindString("Result", &replyCmd) != B_OK)
return ("");
return (replyCmd);
}
示例15: GetDescription
PString ScopeAgent::GetDescription(int32 index)
{
PString description;
description.LoadString(res, IDS_SCOPE_DESCRIPTION);
return (description);
}