lyx_mirror/src/frontends/gtk/IdSc.C
Lars Gullik Bjønnes 9122d5b2df header file reorder
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9012 a592a061-630c-0410-9148-cb99ea01b6c8
2004-09-26 18:36:07 +00:00

39 lines
713 B
C

/**
* \file IdSc.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Huang Ying
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "IdSc.h"
#include "support/lstrings.h"
using lyx::support::split;
using std::string;
/// Extract shortcut from "<identifer>|#<shortcut>" string
string const id_sc::shortcut(string const & idsc)
{
string sc = split(idsc, '|');
if (!sc.empty() && sc[0] == '#')
sc.erase(sc.begin());
return sc;
}
/// Extract identifier from "<identifer>|#<shortcut>" string
string const id_sc::id(string const & idsc)
{
string id;
split(idsc, id, '|');
return id;
}