mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-13 14:32:04 +00:00
44cd0fc9a1
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7862 a592a061-630c-0410-9148-cb99ea01b6c8
38 lines
712 B
C
38 lines
712 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;
|
|
}
|