本文整理汇总了C++中Converter::Convert方法的典型用法代码示例。如果您正苦于以下问题:C++ Converter::Convert方法的具体用法?C++ Converter::Convert怎么用?C++ Converter::Convert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Converter
的用法示例。
在下文中一共展示了Converter::Convert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SysStringByteLen
CMarkdown::HSTR CMarkdown::_HSTR::Convert(const Converter &converter)
{
HSTR H = this;
size_t s = SysStringByteLen(B);
if (size_t d = converter.Convert(A, s, 0, 0))
{
H = (HSTR)SysAllocStringByteLen(0, d);
converter.Convert(A, s, H->A, d);
SysFreeString(B);
}
return H;
}
示例2: main
int main (int argc, char *argv[]) {
try {
static struct option long_options[] = {
{ "source-encoding", required_argument, NULL, 's' },
{ "id3v1-encoding", required_argument, NULL, '1' },
{ "id3v2-encoding", required_argument, NULL, '2' },
{ "preserve-unicode", no_argument, NULL, 'p' },
{ "preview", no_argument, NULL, 'w' },
{ "version", no_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' },
{ "quiet", no_argument, NULL, 'q' },
{ NULL, 0, NULL, 0 }
};
int long_options_ret;
std::string source_encoding;
std::string id3v1_encoding = "none";
std::string id3v2_encoding = "none";
bool preserve_unicode = false;
bool preview = false;
bool usage_ok = true;
bool verbose = true;
if(argc == 1) {
printf("%s", msg::usage);
exit(1);
}
while (
(long_options_ret = getopt_long (argc, argv, "s:1:2:pwdvhq", long_options, NULL)) != -1
) {
switch (long_options_ret) {
case 's':
source_encoding = optarg;
tolower(source_encoding);
break;
case '1':
id3v1_encoding = optarg;
tolower(id3v1_encoding);
break;
case '2':
id3v2_encoding = optarg;
tolower(id3v2_encoding);
break;
case 'p':
preserve_unicode = true;
break;
case 'w':
preview = true;
break;
case 'v':
printf("%s %s\n", PACKAGE, PACKAGE_VERSION);
printf("%s", msg::copyright);
exit (1);
break;
case 'h':
printf("%s", msg::usage);
exit(1);
case 'q':
verbose = false;
break;
default:
usage_ok = false;
break;
}
}
if (usage_ok && source_encoding.empty ()) {
printf("%s", msg::nosenc);
usage_ok = false;
}
if(optind == argc) {
printf("%s", msg::nofiles);
usage_ok = false;
}
if (!usage_ok) {
printf("%s", msg::seehelp);
exit (1);
}
TagLib::ID3v2::FrameFactory::instance()->setDefaultTextEncoding (TagLib::String::UTF8);
for (int i=optind;i<argc;i++) {
TagLib::MPEG::File mp3file(argv[i]);
if (!mp3file.isOpen ()) {
throw msg::nofile(argv[i]);
}
TagLib::Tag *tag = mp3file.tag();
if(tag->isEmpty()) {
printf("%s", msg::emptyfile(argv[i]).c_str());
}
else {
Converter converter (
source_encoding,
id3v1_encoding,
id3v2_encoding,
//.........这里部分代码省略.........