本文整理汇总了C++中nsCString::AppendInt方法的典型用法代码示例。如果您正苦于以下问题:C++ nsCString::AppendInt方法的具体用法?C++ nsCString::AppendInt怎么用?C++ nsCString::AppendInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsCString
的用法示例。
在下文中一共展示了nsCString::AppendInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
SiteHSTSState::ToString(nsCString& aString)
{
aString.Truncate();
aString.AppendInt(mHSTSExpireTime);
aString.Append(',');
aString.AppendInt(mHSTSState);
aString.Append(',');
aString.AppendInt(static_cast<uint32_t>(mHSTSIncludeSubdomains));
}
示例2:
static inline void
GetAuthKey(const char *scheme, const char *host, int32_t port, uint32_t appId, bool inBrowserElement, nsCString &key)
{
key.Truncate();
key.AppendInt(appId);
key.Append(':');
key.AppendInt(inBrowserElement);
key.Append(':');
key.Append(scheme);
key.AppendLiteral("://");
key.Append(host);
key.Append(':');
key.AppendInt(port);
}
示例3: BuildMessageURI
nsresult nsFolderCompactState::BuildMessageURI(const char *baseURI, PRUint32 key, nsCString& uri)
{
uri.Append(baseURI);
uri.Append('#');
uri.AppendInt(key);
return NS_OK;
}
示例4: nsBuildImapMessageURI
nsresult nsBuildImapMessageURI(const char *baseURI, PRUint32 key, nsCString& uri)
{
uri.Append(baseURI);
uri.Append('#');
uri.AppendInt(key);
return NS_OK;
}
示例5: getNumberOfCameras
nsresult
ICameraControl::GetCameraName(uint32_t aDeviceNum, nsCString& aDeviceName)
{
int32_t count = android::Camera::getNumberOfCameras();
int32_t deviceNum = static_cast<int32_t>(aDeviceNum);
DOM_CAMERA_LOGI("GetCameraName : getNumberOfCameras() returned %d\n", count);
if (deviceNum < 0 || deviceNum > count) {
DOM_CAMERA_LOGE("GetCameraName : invalid device number (%u)\n", aDeviceNum);
return NS_ERROR_INVALID_ARG;
}
android::CameraInfo info;
int rv = android::Camera::getCameraInfo(deviceNum, &info);
if (rv != 0) {
DOM_CAMERA_LOGE("GetCameraName : get_camera_info(%d) failed: %d\n", deviceNum, rv);
return NS_ERROR_NOT_AVAILABLE;
}
switch (info.facing) {
case CAMERA_FACING_BACK:
aDeviceName.AssignLiteral("back");
break;
case CAMERA_FACING_FRONT:
aDeviceName.AssignLiteral("front");
break;
default:
aDeviceName.AssignLiteral("extra-camera-");
aDeviceName.AppendInt(deviceNum);
break;
}
return NS_OK;
}
示例6: getNumberOfCameras
nsresult
nsDOMCameraManager::GetCameraName(uint32_t aDeviceNum, nsCString& aDeviceName)
{
int32_t count = android::Camera::getNumberOfCameras();
DOM_CAMERA_LOGI("GetCameraName : getNumberOfCameras() returned %d\n", count);
if (aDeviceNum > count) {
DOM_CAMERA_LOGE("GetCameraName : invalid device number");
return NS_ERROR_NOT_AVAILABLE;
}
android::CameraInfo info;
int rv = android::Camera::getCameraInfo(aDeviceNum, &info);
if (rv != 0) {
DOM_CAMERA_LOGE("GetCameraName : get_camera_info(%d) failed: %d\n", aDeviceNum, rv);
return NS_ERROR_NOT_AVAILABLE;
}
switch (info.facing) {
case CAMERA_FACING_BACK:
aDeviceName.Assign("back");
break;
case CAMERA_FACING_FRONT:
aDeviceName.Assign("front");
break;
default:
aDeviceName.Assign("extra-camera-");
aDeviceName.AppendInt(aDeviceNum);
break;
}
return NS_OK;
}
示例7:
static void
AppendToFaceList(nsCString& aFaceList,
nsAString& aFamilyName, FT2FontEntry* aFontEntry)
{
aFaceList.Append(NS_ConvertUTF16toUTF8(aFamilyName));
aFaceList.Append(',');
aFaceList.Append(NS_ConvertUTF16toUTF8(aFontEntry->Name()));
aFaceList.Append(',');
aFaceList.AppendInt(aFontEntry->mFTFontIndex);
aFaceList.Append(',');
aFaceList.Append(aFontEntry->IsItalic() ? '1' : '0');
aFaceList.Append(',');
aFaceList.AppendInt(aFontEntry->Weight());
aFaceList.Append(',');
aFaceList.AppendInt(aFontEntry->Stretch());
aFaceList.Append(',');
}
示例8: nsBuildLocalMessageURI
nsresult nsBuildLocalMessageURI(const char *baseURI, nsMsgKey key, nsCString& uri)
{
// need to convert mailbox://hostname/.. to mailbox-message://hostname/..
uri.Append(baseURI);
uri.Append('#');
uri.AppendInt(key);
return NS_OK;
}
示例9: ListPropertyValue
void CMapiApi::ListPropertyValue( LPSPropValue pVal, nsCString& s)
{
nsCString strVal;
char nBuff[64];
nsCString t;
s += "value: ";
switch (PROP_TYPE( pVal->ulPropTag)) {
case PT_STRING8:
GetStringFromProp( pVal, strVal, FALSE);
if (strVal.Length() > 60) {
strVal.Left( t, 60);
strVal = t;
strVal += "...";
}
ReplaceEolChars( strVal);
s += strVal;
break;
case PT_LONG:
s.AppendInt( (PRInt32) pVal->Value.l);
s += ", 0x";
s.AppendInt( (PRInt32) pVal->Value.l, 16);
s += nBuff;
break;
case PT_BOOLEAN:
if (pVal->Value.b)
s += "True";
else
s += "False";
break;
case PT_NULL:
s += "--NULL--";
break;
case PT_SYSTIME: {
/*
COleDateTime tm( pVal->Value.ft);
s += tm.Format();
*/
s += "-- Figure out how to format time in mozilla, PT_SYSTIME --";
}
break;
default:
s += "?";
}
}
示例10:
// maxSize may be -1 if unknown
static void
MakeRangeSpec(const PRInt64 &size, const PRInt64 &maxSize, PRInt32 chunkSize,
PRBool fetchRemaining, nsCString &rangeSpec)
{
rangeSpec.AssignLiteral("bytes=");
rangeSpec.AppendInt(PRInt64(size));
rangeSpec.Append('-');
if (fetchRemaining)
return;
PRInt64 end = size + PRInt64(chunkSize);
if (maxSize != PRInt64(-1) && end > maxSize)
end = maxSize;
end -= 1;
rangeSpec.AppendInt(PRInt64(end));
}
示例11:
static inline void
GetAuthKey(const char *scheme, const char *host, PRInt32 port, nsCString &key)
{
key.Assign(scheme);
key.AppendLiteral("://");
key.Append(host);
key.Append(':');
key.AppendInt(port);
}
示例12:
// maxSize may be -1 if unknown
static void
MakeRangeSpec(PRInt64 size, PRInt64 maxSize, PRInt32 chunkSize,
PRBool fetchRemaining, nsCString &rangeSpec)
{
rangeSpec.AssignLiteral("bytes=");
rangeSpec.AppendInt(size);
rangeSpec.Append('-');
if (fetchRemaining)
return;
PRInt64 end = size + chunkSize;
if (maxSize != -1 && end > maxSize)
end = maxSize;
end -= 1;
rangeSpec.AppendInt(end);
}
示例13:
// maxSize may be -1 if unknown
static void
MakeRangeSpec(const int64_t &size, const int64_t &maxSize, int32_t chunkSize,
bool fetchRemaining, nsCString &rangeSpec)
{
rangeSpec.AssignLiteral("bytes=");
rangeSpec.AppendInt(int64_t(size));
rangeSpec.Append('-');
if (fetchRemaining)
return;
int64_t end = size + int64_t(chunkSize);
if (maxSize != int64_t(-1) && end > maxSize)
end = maxSize;
end -= 1;
rangeSpec.AppendInt(int64_t(end));
}
示例14: FormatSizeString
void nsIndexedToHTML::FormatSizeString(int64_t inSize, nsCString& outSizeString)
{
outSizeString.Truncate();
if (inSize > int64_t(0)) {
// round up to the nearest Kilobyte
int64_t upperSize = (inSize + int64_t(1023)) / int64_t(1024);
outSizeString.AppendInt(upperSize);
outSizeString.AppendLiteral(" KB");
}
}
示例15: AppendNonAsciiToNCR
static void AppendNonAsciiToNCR(const nsAString& in, nsCString& out)
{
nsAString::const_iterator start, end;
in.BeginReading(start);
in.EndReading(end);
while (start != end) {
if (*start < 128) {
out.Append(*start++);
} else {
out.AppendLiteral("&#x");
out.AppendInt(*start++, 16);
out.Append(';');
}
}
}