]> git.lyx.org Git - features.git/blob - src/frontends/gtk/IdSc.C
The Gtk patch.
[features.git] / src / frontends / gtk / IdSc.C
1 /**
2  * \file IdSc.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Huang Ying
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13 #include "IdSc.h"
14 #include "support/lstrings.h"
15
16 using lyx::support::split;
17
18
19 /// Extract shortcut from "<identifer>|#<shortcut>" string
20 string const id_sc::shortcut(string const & idsc)
21 {
22         string sc = split(idsc, '|');
23         if (!sc.empty() && sc[0] == '#')
24                 sc.erase(sc.begin());
25         return sc;
26 }
27
28
29 /// Extract identifier from "<identifer>|#<shortcut>" string
30 string const id_sc::id(string const & idsc)
31 {
32         string id;
33         split(idsc, id, '|');
34         return id;
35 }