本文整理匯總了C++中AsString函數的典型用法代碼示例。如果您正苦於以下問題:C++ AsString函數的具體用法?C++ AsString怎麽用?C++ AsString使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AsString函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: MakeInvocation
static FObject MakeInvocation(int argc, FChS * argv[])
{
uint_t sl = -1;
for (int adx = 0; adx < argc; adx++)
sl += StringLengthS(argv[adx]) + 1;
FObject s = MakeString(0, sl);
uint_t sdx = 0;
for (int adx = 0; adx < argc; adx++)
{
sl = StringLengthS(argv[adx]);
for (uint_t idx = 0; idx < sl; idx++)
{
AsString(s)->String[sdx] = argv[adx][idx];
sdx += 1;
}
if (adx + 1 < argc)
{
AsString(s)->String[sdx] = ' ';
sdx += 1;
}
}
return(s);
}
示例2: AsString
mf::http::SharedBuffer::Pointer Impl::GetPostData()
{
std::map<std::string, std::string> parts;
if (quickkey_)
parts["quick_key"] = *quickkey_;
if (get_counts_only_)
parts["get_counts_only"] = AsString(*get_counts_only_);
if (duration_minutes_)
parts["duration"] = AsString(*duration_minutes_);
if (nofify_owner_on_access_)
parts["email_notification"] = AsString(*nofify_owner_on_access_);
if (success_callback_url_)
parts["success_callback_url"] = *success_callback_url_;
if (error_callback_url_)
parts["error_callback_url"] = *error_callback_url_;
if (bind_ip_)
parts["bind_ip"] = *bind_ip_;
if (burn_after_use_)
parts["burn_after_use"] = AsString(*burn_after_use_);
std::string post_data = MakePost(api_path + ".php", parts);
AddDebugText(" POST data: " + post_data + "\n");
return mf::http::SharedBuffer::Create(post_data);
}
示例3: switch
String RichPara::Number::AsText(const RichPara::NumberFormat& format) const
{
String result;
for(int i = 0; i < 8; i++)
if(format.number[i]) {
if(result.GetLength())
result.Cat('.');
int q = n[i];
switch(format.number[i]) {
case NUMBER_1:
result << AsString(q);
break;
case NUMBER_0:
result << AsString(q - 1);
break;
case NUMBER_a:
result << FormatIntAlpha(q, false);
break;
case NUMBER_A:
result << FormatIntAlpha(q, true);
break;
case NUMBER_i:
result << FormatIntRoman(q, false);
break;
case NUMBER_I:
result << FormatIntRoman(q, true);
break;
}
}
return format.before_number + result + format.after_number;
}
示例4: AddFontResourceExW
void plWinFontCache::ILoadCustomFonts( void )
{
if( fCustFontDir == nil )
return;
// Iterate through all the custom fonts in our dir
int numAdded;
std::vector<plFileName> fonts = plFileSystem::ListDir(fCustFontDir, kCustFontExtension);
for (auto iter = fonts.begin(); iter != fonts.end(); ++iter)
{
// Note that this call can be translated as "does my OS suck?"
#if (_WIN32_WINNT >= 0x0500)
if( plDynSurfaceWriter::CanHandleLotsOfThem() )
numAdded = AddFontResourceExW(iter->AsString().ToWchar(), FR_PRIVATE, 0);
else
#endif
numAdded = AddFontResourceW(iter->AsString().ToWchar());
if( numAdded > 0 )
{
plStatusLog::AddLineS( "pipeline.log", "WinFontCache: Added custom font %s, %d fonts", iter->GetFileName().c_str(), numAdded );
fCustFonts.Append(new plCustFont(*iter));
}
else
{
plStatusLog::AddLineS( "pipeline.log", "WinFontCache: Unable to load custom font %s", iter->GetFileName().c_str() );
}
}
}
示例5: Clear
void defList::Load(String filePath)
{
Clear() ;
path = filePath ;
name = GetFileTitle(path) ;
VectorMap<String,String> ini = LoadIniFile(path) ;
fields = Split(ini.Get("fields", ""), ',' ) ;
CSVParser csv ;
for( int i=0; true; i++)
{
String s = ini.Get("data_" + AsString(i), "") ;
if (s.IsEmpty())
break ;
data.Add(csv.ParseLine(s, fields.GetCount()) ) ;
}
for (int i=0; true; i++)
{
String s = ini.Get("error_" + AsString(i), "") ;
if (s.IsEmpty())
break ;
errors.Add(s) ;
}
// guardamos este como último cargado
theCfg.lastList = path ;
theCfg.Save() ;
}
示例6: AsString
void InvoiceList::formatHeader(StringBuffer &buf)
{
buf.Cat("{{1:1~ ");
buf.Cat("[*A3 " + AsString(t_("Invoice list")) + "] :: [*A3 ]:: ");
buf.Cat("[A1 " + AsString(t_("Date from:")) + "-|" + AsString(from));
buf.Cat("&" + AsString(t_("Date to:")) + "-|" + AsString(to));
buf.Cat("]:: ");
buf.Cat("}}");
}
示例7: return
Value Compiler::ExeNeq::Eval(ExeContext& x) const
{
Value v1 = a->Eval(x);
Value v2 = b->Eval(x);
if(IsString(v1) && IsString(v2))
return (String)v1 != (String)v2;
if(IsNumber(v1) && IsNumber(v2))
return (double)v1 != (double)v2;
return AsString(v1) != AsString(v2);
}
示例8: AsString
void InvoiceFormatter::formatHeader(StringBuffer &buf, InvoiceData &invoice) {
buf.Cat("{{1:1~ ");
buf.Cat("[*A3 " + AsString(t_("Invoice")) + "] :: [*A3 " + AsString(t_("invoice num:")) + " " + AsString(invoice.inv_id) + "]:: ");
buf.Cat("[A1 " + AsString(t_("Create date:")) + "-|-|-|" + AsString(invoice.create_date));
if (lang != LANG_CZ) {
buf.Cat("&" + AsString(t_("Delivery date:")) + "-|-|" + AsString(invoice.delivery_date) + "&");
buf.Cat(AsString(t_("Payment date:")) + "-|-|-|" + AsString(invoice.payment_date) );
}
buf.Cat("]:: ");
// no payment type in CZ
if (lang != LANG_CZ) {
String type;
switch (invoice.payment_type)
{
case iptCurrency:
type = t_("currency");
break;
case iptBankTransfer:
type = t_("bank transfer");
break;
default:
type = t_("currency");
}
buf.Cat("[A1 " + AsString(t_("Payment type:")) + "-|-|" + type + "]&");
}
buf.Cat("}}");
}
示例9: GetVolumeSn
String GetVolumeSn(const String &vol, int len) {
dword sn;
// Win API
if(!GetVolumeInformation(vol, NULL, 0, &sn, NULL, NULL, NULL, 0)) sn = 71511731;
#ifdef _WITH_DEBUG
RLOG("GetVolumeSn():sn = " + AsString(sn));
#endif
return String(AsString(sn)).Right(len);
}
示例10: AsString
mf::http::SharedBuffer::Pointer Impl::GetPostData()
{
std::map<std::string, std::string> parts;
parts["quick_key"] = AsString(quickkeys_);
if (link_types_)
parts["link_type"] = AsString(*link_types_);
std::string post_data = MakePost(api_path + ".php", parts);
AddDebugText(" POST data: " + post_data + "\n");
return mf::http::SharedBuffer::Create(post_data);
}
示例11: AsString
void Ide::AddFoundFile(const String& fn, int ln, const String& line, int pos, int count)
{
ErrorInfo f;
f.file = fn;
f.lineno = ln;
f.linepos = 0;
f.kind = 0;
f.message = "\1" + EditorSyntax::GetSyntaxForFilename(fn) + "\1" +
AsString(pos) + "\1" + AsString(count) + "\1" + line;
ffound.Add(fn, ln, f.message, RawToValue(f));
ffound.Sync();
}
示例12: AsString
mf::http::SharedBuffer::Pointer Impl::GetPostData()
{
std::map<std::string, std::string> parts;
parts["quick_key"] = quickkey_;
parts["source_revision"] = AsString(source_revision_);
parts["target_revision"] = AsString(target_revision_);
std::string post_data = MakePost(api_path + ".php", parts);
AddDebugText(" POST data: " + post_data + "\n");
return mf::http::SharedBuffer::Create(post_data);
}
示例13: AsString
mf::http::SharedBuffer::Pointer Impl::GetPostData()
{
std::map<std::string, std::string> parts;
if (product_id_)
parts["product_id"] = AsString(*product_id_);
if (family_)
parts["family"] = AsString(*family_);
std::string post_data = MakePost(api_path + ".php", parts);
AddDebugText(" POST data: " + post_data + "\n");
return mf::http::SharedBuffer::Create(post_data);
}
示例14: Format
//Вывод в файл список в формате Оригинал - Русское - количество эпизодов
void AnimeList::PrintFile()
{
if(!fs.ExecuteSaveAs()) return;
String printfile = fs;
String xml, name, namerus, episodes;
for(int i = 0; i < listName.GetCount(); i++)
{
xml += Format(AsString(listName.Get(i, Named)) + " - " + AsString(listName.Get(i, NamedRus)) + " - Episodes: %d", listName.Get(i, Episodes));
RawCat(xml, "\r\n");
}
if(!SaveFile(printfile, xml))
Exclamation("Error Saving the File");
}
示例15: AsString
mf::http::SharedBuffer::Pointer Impl::GetPostData()
{
std::map<std::string, std::string> parts;
if (previous_file_versions_)
parts["previous_file_versions"] = AsString(*previous_file_versions_);
if (default_share_link_status_)
parts["default_share_link_status"] = AsString(*default_share_link_status_);
if (collect_metadata_)
parts["collect_metadata"] = AsString(*collect_metadata_);
std::string post_data = MakePost(api_path + ".php", parts);
AddDebugText(" POST data: " + post_data + "\n");
return mf::http::SharedBuffer::Create(post_data);
}