]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/IdSc.C
Minipage is no more (long live the box inset)
[lyx.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 using std::string;
19
20
21 /// Extract shortcut from "<identifer>|#<shortcut>" string
22 string const id_sc::shortcut(string const & idsc)
23 {
24         string sc = split(idsc, '|');
25         if (!sc.empty() && sc[0] == '#')
26                 sc.erase(sc.begin());
27         return sc;
28 }
29
30
31 /// Extract identifier from "<identifer>|#<shortcut>" string
32 string const id_sc::id(string const & idsc)
33 {
34         string id;
35         split(idsc, id, '|');
36         return id;
37 }