• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ quote函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中quote函数的典型用法代码示例。如果您正苦于以下问题:C++ quote函数的具体用法?C++ quote怎么用?C++ quote使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了quote函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: show_utf8

static void show_utf8(FILE *f, const char *text, const char *pre, const char *post, int is_attribute)
{
	int len;

	if (!text)
		return;
	while (isspace(*text))
		text++;
	len = strlen(text);
	if (!len)
		return;
	while (len && isspace(text[len-1]))
		len--;
	/* FIXME! Quoting! */
	fputs(pre, f);
	quote(f, text, is_attribute);
	fputs(post, f);
}
开发者ID:dreinhold,项目名称:subsurface,代码行数:18,代码来源:save-xml.c


示例2: makedir

static int makedir(const string& name, std::ostream& msg, bool user_only = false)
{
    StreamAction action(msg, "Creating " + quote(name + "/"));

    mode_t mask = umask(0);
    umask(mask);
    mode_t mode;
    if (user_only)
	mode = S_IRWXU & ~mask;
    else
	mode = (S_IRWXU | S_IRWXG | S_IRWXO) & ~mask;
    int ret = mkdir(name.chars(), mode);

    if (ret != 0)
	action.failed(strerror(errno));

    return ret;
}
开发者ID:Stabledog,项目名称:dddbash,代码行数:18,代码来源:session.C


示例3: xheader_set_keyword_equal

static void
xheader_set_keyword_equal (char *kw, char *eq)
{
  bool global = true;
  char *p = eq;

  if (eq[-1] == ':')
    {
      p--;
      global = false;
    }

  while (p > kw && isspace ((unsigned char) *p))
    p--;

  *p = 0;

  for (p = eq + 1; *p && isspace ((unsigned char) *p); p++)
    ;

  if (strcmp (kw, "delete") == 0)
    {
      if (xheader_protected_pattern_p (p))
	USAGE_ERROR ((0, 0, _("Pattern %s cannot be used"), quote (p)));
      xheader_list_append (&keyword_pattern_list, p, NULL);
    }
  else if (strcmp (kw, "exthdr.name") == 0)
    assign_string (&exthdr_name, p);
  else if (strcmp (kw, "globexthdr.name") == 0)
    assign_string (&globexthdr_name, p);
  else if (strcmp (kw, "exthdr.mtime") == 0)
    assign_time_option (&exthdr_mtime_option, &exthdr_mtime, p);
  else if (strcmp (kw, "globexthdr.mtime") == 0)
    assign_time_option (&globexthdr_mtime_option, &globexthdr_mtime, p);
  else
    {
      if (xheader_protected_keyword_p (kw))
	USAGE_ERROR ((0, 0, _("Keyword %s cannot be overridden"), kw));
      if (global)
	xheader_list_append (&keyword_global_override_list, kw, p);
      else
	xheader_list_append (&keyword_override_list, kw, p);
    }
}
开发者ID:GrayKing,项目名称:LeakFix-on-Tar,代码行数:44,代码来源:xheader.c


示例4: compute_output_file_names

void
compute_output_file_names (void)
{
  char const *name[4];
  int i;
  int j;
  int names = 0;

  compute_file_name_parts ();

  /* If not yet done. */
  if (!src_extension)
    src_extension = ".c";
  if (!header_extension)
    header_extension = ".h";

  name[names++] = parser_file_name =
    spec_outfile ? spec_outfile : concat2 (all_but_ext, src_extension);

  if (defines_flag)
    {
      if (! spec_defines_file)
	spec_defines_file = concat2 (all_but_ext, header_extension);
      name[names++] = spec_defines_file;
    }

  if (graph_flag)
    {
      if (! spec_graph_file)
	spec_graph_file = concat2 (all_but_tab_ext, ".vcg");
      name[names++] = spec_graph_file;
    }

  if (report_flag)
    {
      spec_verbose_file = concat2 (all_but_tab_ext, OUTPUT_EXT);
      name[names++] = spec_verbose_file;
    }

  for (j = 0; j < names; j++)
    for (i = 0; i < j; i++)
      if (strcmp (name[i], name[j]) == 0)
	warn (_("conflicting outputs to file %s"), quote (name[i]));
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:44,代码来源:files.c


示例5: SaveTipCountCB

static void SaveTipCountCB(Widget, XtPointer = 0, XtPointer = 0)
{
    create_session_dir(DEFAULT_SESSION);
    const string file = session_tips_file();

    std::ofstream os(file.chars());
    os << 
	"! " DDD_NAME " tips file\n"
	"\n"
       << app_value(XtNstartupTipCount,
		    itostring(++app_data.startup_tip_count)) << "\n";

    os.close();
    if (os.bad())
    {
	post_error("Cannot save tip count in " + quote(file),
		   "options_save_error");
    }
}
开发者ID:fooeybartoni,项目名称:CSI702,代码行数:19,代码来源:tips.C


示例6: muscle_percent_define_insert

void
muscle_percent_define_insert (char const *var, location variable_loc,
                              muscle_kind kind,
                              char const *value,
                              muscle_percent_define_how how)
{
  /* Backward compatibility.  */
  char *variable = muscle_percent_variable_update (var, variable_loc, &value);
  uniqstr name = muscle_name (variable, NULL);
  uniqstr loc_name = muscle_name (variable, "loc");
  uniqstr syncline_name = muscle_name (variable, "syncline");
  uniqstr how_name = muscle_name (variable, "how");
  uniqstr kind_name = muscle_name (variable, "kind");

  /* Command-line options are processed before the grammar file.  */
  if (how == MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
      && muscle_find_const (name))
    {
      muscle_percent_define_how how_old = atoi (muscle_find_const (how_name));
      unsigned i = 0;
      if (how_old == MUSCLE_PERCENT_DEFINE_F)
        goto end;
      complain_indent (&variable_loc, complaint, &i,
                       _("%%define variable %s redefined"),
                       quote (variable));
      i += SUB_INDENT;
      location loc = muscle_percent_define_get_loc (variable);
      complain_indent (&loc, complaint, &i, _("previous definition"));
    }

  MUSCLE_INSERT_STRING (name, value);
  muscle_insert (loc_name, "");
  muscle_location_grow (loc_name, variable_loc);
  muscle_insert (syncline_name, "");
  muscle_syncline_grow (syncline_name, variable_loc);
  muscle_user_name_list_grow ("percent_define_user_variables", variable,
                              variable_loc);
  MUSCLE_INSERT_INT (how_name, how);
  MUSCLE_INSERT_STRING (kind_name, muscle_kind_string (kind));
 end:
  free (variable);
}
开发者ID:AnotherView,项目名称:bison,代码行数:42,代码来源:muscle-tab.c


示例7: gdbChangeDirectoryDCB

// ChangeDirectory program with given arguments
static void gdbChangeDirectoryDCB(Widget, XtPointer, XtPointer)
{
    Widget text = XmSelectionBoxGetChild(cd_dialog, XmDIALOG_TEXT);
    String _args = XmTextGetString(text);
    string args(_args);
    XtFree(_args);

    string path = source_view->full_path(args);
    switch (gdb->type()) {
    case PERL:
      gdb_command("chdir " + quote(path, '\''));
      break;
    case BASH:
      gdb_command("eval cd " + path);
      break;
    default:
      gdb_command("cd " + path);
    }
    
}
开发者ID:fooeybartoni,项目名称:CSI702,代码行数:21,代码来源:args.C


示例8: addBrackets

// Reformulate explicit user constraint so it matches the format of the constraint parser
string ConstraintFomatter::consToFormula(const Model & model, const CompID ID)
{
	string formula; // Resulting formula specifying all the constraints

	formula = "tt";

	for (const string constraint : model.components[ID].constraints)
	{
		try
		{
			formula.append(" & " + addBrackets(formatConstraint(constraint, model, ID)));
		}
		catch (exception & e)
		{
			throw runtime_error("Error while parsing the constraint: " + quote(constraint) + ". " + e.what());
		}
	}

	return addBrackets(formula);
}
开发者ID:xstreck1,项目名称:TREMPPI,代码行数:21,代码来源:constraint_formatter.cpp


示例9: dump_rec

void dump_rec(const char* var, int i, struct initrec* p)
{
	char** a;

	printf("static struct initrec %s%i = {\n", var, i);

	printf("\t.name = %s,\n", quote(p->name));
	printf("\t.rlvl = %i,\n", p->rlvl);
	printf("\t.flags = %i,\n", p->flags);
	printf("\t.pid = %i,\n", p->pid);
	printf("\t.lastrun = %li,\n", (long)p->lastrun);
	printf("\t.lastsig = %li,\n", (long)p->lastsig);
	printf("\t.argv = { ");
	for(a = p->argv; *a; a++)
		// no quoting for now
		printf("\"%s\", ", *a);
		printf(" NULL }\n");

	printf("};\n");
}
开发者ID:arsv,项目名称:sninit,代码行数:20,代码来源:statictab.c


示例10: start_graph

void
start_graph (FILE *fout)
{
  fprintf (fout,
           _("// Generated by %s.\n"
             "// Report bugs to <%s>.\n"
             "// Home page: <%s>.\n"
             "\n"),
           PACKAGE_STRING,
           PACKAGE_BUGREPORT,
           PACKAGE_URL);
  fprintf (fout,
           "digraph %s\n"
           "{\n",
           quote (grammar_file));
  fprintf (fout,
           "  node [fontname = courier, shape = box, colorscheme = paired6]\n"
           "  edge [fontname = courier]\n"
           "\n");
}
开发者ID:Distrotech,项目名称:bison,代码行数:20,代码来源:graphviz.c


示例11: Urn

	bool
	ClientImpl::sync_upload(
		std::string remote_file, 
		std::string local_file, 
		callback_t callback, 
		progress_t progress
	) noexcept
	{
		bool is_existed = FileInfo::exists(local_file);
		if (!is_existed) return false;

		auto root_urn = Urn(this->webdav_root, true);
		auto file_urn = root_urn + remote_file;

		std::ifstream file_stream(local_file, std::ios::binary);
		auto size = FileInfo::size(local_file);

		Request request(this->options());

		auto url = this->webdav_hostname + file_urn.quote(request.handle);

		Data response = { 0, 0, 0 };

		request.set(CURLOPT_UPLOAD, 1L);
		request.set(CURLOPT_URL, url.c_str());
		request.set(CURLOPT_READDATA, (size_t)&file_stream);
		request.set(CURLOPT_READFUNCTION, (size_t)Callback::Read::stream);
		request.set(CURLOPT_INFILESIZE_LARGE, (curl_off_t)size);
		request.set(CURLOPT_BUFFERSIZE, (long)Client::buffer_size);
		request.set(CURLOPT_WRITEDATA, (size_t)&response);
		request.set(CURLOPT_WRITEFUNCTION, (size_t)Callback::Append::buffer);
		if (progress != nullptr) {
			request.set(CURLOPT_XFERINFOFUNCTION, (size_t)progress.target<progress_funptr>());
			request.set(CURLOPT_NOPROGRESS, 0L);
		}

		bool is_performed = request.perform();

		if (callback != nullptr) callback(is_performed);
		return is_performed;
	}
开发者ID:mbcslava,项目名称:webdav-client-cpp,代码行数:41,代码来源:client.cpp


示例12: love_album

static int
love_album(struct mpdcron_connection *conn, bool love, const char *expr)
{
	int changes;
	char *esc_album, *myexpr;
	struct mpd_song *song;

	if (expr != NULL) {
		if (!mpdcron_love_album_expr(conn, love, expr, &changes)) {
			eulog(LOG_ERR, "Failed to %s album: %s",
					love ? "love" : "hate",
					conn->error->message);
			return 1;
		}
	}
	else {
		if ((song = load_current_song()) == NULL)
			return 1;
		else if (mpd_song_get_tag(song, MPD_TAG_ALBUM, 0) == NULL) {
			eulog(LOG_ERR, "Current playing song has no album tag!");
			mpd_song_free(song);
			return 1;
		}

		esc_album = quote(mpd_song_get_tag(song, MPD_TAG_ALBUM, 0));
		myexpr = g_strdup_printf("name=%s", esc_album);
		g_free(esc_album);
		mpd_song_free(song);

		if (!mpdcron_love_album_expr(conn, love, myexpr, &changes)) {
			eulog(LOG_ERR, "Failed to %s current playing album: %s",
					love ? "love" : "hate",
					conn->error->message);
			g_free(myexpr);
			return 1;
		}
		g_free(myexpr);
	}
	printf("Modified %d entries\n", changes);
	return 0;
}
开发者ID:alip,项目名称:mpdcron,代码行数:41,代码来源:eugene-love.c


示例13: query

    bool PostgreAdapter::update(std::string table_I, std::map<std::string, std::string> attributes_I, std::map<std::string, std::string> where_I)
    {
        std::ostringstream query("");
        query
            << "UPDATE "
            << table_I
            << " SET ";

        for (auto& it: attributes_I) {
            if (it != *attributes_I.begin())
                query << ", ";
            query
                << it.first
                << " = "
                << quote(it.second);
        }

        query << makeWhere(where_I);

        return tryQuery(query.str());
    }
开发者ID:rainlabs,项目名称:cpp-everyday,代码行数:21,代码来源:postgre_adapter.cpp


示例14: addModifier

void CChemEqInterface::addModifier(const std::string & name)
{
  std::pair< std::string, std::string > Modifier =
    CMetabNameInterface::splitDisplayName(name);

  //is the name already in the list
  std::vector< std::string >::const_iterator it, itEnd = mModifierNames.end();
  std::vector< std::string >::const_iterator itComp = mModifierCompartments.begin();

  for (it = mModifierNames.begin(); it != itEnd; ++it, ++itComp)
    if (Modifier.first == *it &&
        Modifier.second == *itComp) break;

  if (it == itEnd)
    {
      mModifierNames.push_back(Modifier.first);
      mModifierMult.push_back(1.0);
      mModifierCompartments.push_back(Modifier.second);
      mModifierDisplayNames.push_back(quote(name));
    }
}
开发者ID:PriKalra,项目名称:COPASI,代码行数:21,代码来源:CChemEqInterface.cpp


示例15: QString

bool BrowserFlow::undelete(bool, QString & warning, QString & renamed)
{
    if (! deletedp())
        return FALSE;

    if (def->get_start_node()->deletedp() ||
        def->get_end_node()->deletedp()) {
        warning += QString("<li><b>") + quote(name) + "</b> " + TR("from") + " <b>" +
                   def->get_start_node()->full_name() +
                   "</b> " + TR("to") + " <b>" + def->get_end_node()->full_name() + "</b>\n";
        return FALSE;
    }

    is_deleted = FALSE;
    def->undelete(warning, renamed);

    package_modified();
    repaint();

    return TRUE;
}
开发者ID:jeremysalwen,项目名称:douml,代码行数:21,代码来源:BrowserFlow.cpp


示例16: GetImpl

	strings_t
	Client::list(std::string remote_directory) noexcept
	{
		auto clientImpl = GetImpl(this);
		bool is_existed = this->check(remote_directory);
		if (!is_existed) return strings_t();

		bool is_directory = this->is_dir(remote_directory);
		if (!is_directory) return strings_t();
		auto target_urn = Urn(clientImpl->ftps_root, true) + remote_directory;
		target_urn = Urn(target_urn.path(), true);

		Header header = {
				"Accept: */*",
				"Depth: 1"
		};

		Data data = { 0, 0, 0 };

		Request request(clientImpl->options());

		auto url = clientImpl->ftps_hostname + target_urn.quote(request.handle);

		request.set(CURLOPT_CUSTOMREQUEST, "PROPFIND");
		request.set(CURLOPT_URL, url.c_str());
		request.set(CURLOPT_HTTPHEADER, (struct curl_slist *)header.handle);
		request.set(CURLOPT_HEADER, 0);
		request.set(CURLOPT_WRITEDATA, (size_t)&data);
		request.set(CURLOPT_WRITEFUNCTION, (size_t)Callback::Append::buffer);

		bool is_performed = request.perform();

		if (!is_performed) return strings_t();

		strings_t resources;

		// TODO

		return resources;
	}
开发者ID:gitter-badger,项目名称:ftps-client-cpp,代码行数:40,代码来源:client.cpp


示例17: count_genre

static int
count_genre(struct mpdcron_connection *conn, const char *expr,
		const char *count)
{
	int changes;
	char *esc_genre, *myexpr;
	struct mpd_song *song;

	if (expr != NULL) {
		if (!mpdcron_count_genre_expr(conn, expr, count, &changes)) {
			eulog(LOG_ERR, "Failed to change play count of genre: %s",
					conn->error->message);
			return 1;
		}
	}
	else {
		if ((song = load_current_song()) == NULL)
			return 1;
		else if (mpd_song_get_tag(song, MPD_TAG_GENRE, 0) == NULL) {
			eulog(LOG_ERR, "Current playing song has no genre tag!");
			mpd_song_free(song);
			return 1;
		}

		esc_genre = quote(mpd_song_get_tag(song, MPD_TAG_GENRE, 0));
		myexpr = g_strdup_printf("name=%s", esc_genre);
		g_free(esc_genre);
		mpd_song_free(song);

		if (!mpdcron_count_genre_expr(conn, myexpr, count, &changes)) {
			eulog(LOG_ERR, "Failed to change play count of count current playing genre: %s",
					conn->error->message);
			g_free(myexpr);
			return 1;
		}
		g_free(myexpr);
	}
	printf("Modified %d entries\n", changes);
	return 0;
}
开发者ID:alip,项目名称:mpdcron,代码行数:40,代码来源:eugene-count.c


示例18: rmtag_artist

static int
rmtag_artist(struct mpdcron_connection *conn, const char *tag, const char *expr)
{
	int changes;

	if (expr != NULL) {
		if (!mpdcron_rmtag_artist_expr(conn, expr, tag, &changes)) {
			eulog(LOG_ERR, "Failed to remove tag from artist: %s",
					conn->error->message);
			return 1;
		}
	}
	else {
		char *esc_artist, *myexpr;
		struct mpd_song *song;

		if ((song = load_current_song()) == NULL)
			return 1;
		else if (mpd_song_get_tag(song, MPD_TAG_ARTIST, 0) == NULL) {
			eulog(LOG_ERR, "Current playing song has no artist tag!");
			mpd_song_free(song);
			return 1;
		}

		esc_artist = quote(mpd_song_get_tag(song, MPD_TAG_ARTIST, 0));
		myexpr = g_strdup_printf("name=%s", esc_artist);
		g_free(esc_artist);
		mpd_song_free(song);

		if (!mpdcron_rmtag_artist_expr(conn, myexpr, tag, &changes)) {
			eulog(LOG_ERR, "Failed to remove tag from current playing artist: %s",
					conn->error->message);
			g_free(myexpr);
			return 1;
		}
		g_free(myexpr);
	}
	printf("Modified %d entries\n", changes);
	return 0;
}
开发者ID:kaivalagi,项目名称:mpdcron,代码行数:40,代码来源:eugene-rmtag.c


示例19: ticker

//-----------------------------------------------------------------------------------------------------//
STDMETHODIMP CMarketDataProvider::_AcceptQuote(const QuoteUpdateParams& Params, QuoteUpdateInfo& Info)
{
	HRESULT __Result = E_FAIL;
	try
	{
		CTicker	ticker(Params);
		CQuote	quote(Info);

		AcceptQuote(ticker, quote);
		
		__Result = S_OK;
	}
	catch (_com_error& err)
	{
		TRACE_COM_ERROR(err);
	}
	catch (...)
	{
		TRACE_UNKNOWN_ERROR();
	}
	return __Result;
};
开发者ID:AlexS2172,项目名称:IVRM,代码行数:23,代码来源:MarketDataProvider.cpp


示例20: quote

// Parsing
DispValue *DispValue::parse(DispValue *parent, 
			    int        depth,
			    string&    value,
			    const string& full_name, 
			    const string& print_name,
			    DispValueType type)
{
    if (value_hook != 0)
    {
	DispValue *dv = (*value_hook)(value);
	if (dv != 0)
	{
	    // Just take values from given element
#if LOG_CREATE_VALUES
	    std::clog << "External value " << quote(dv->full_name()) << "\n";
#endif
	    return dv;
	}
    }

    return new DispValue(parent, depth, value, full_name, print_name, type);
}
开发者ID:fooeybartoni,项目名称:CSI702,代码行数:23,代码来源:DispValue.C



注:本文中的quote函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ quote_identifier函数代码示例发布时间:2022-05-30
下一篇:
C++ quotactl函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap