]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/IdSc.C
Change glob() API to accept a dir parameter.
[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
15 #include "support/lstrings.h"
16
17 using lyx::support::split;
18
19 using std::string;
20
21
22 /// Extract shortcut from "<identifer>|#<shortcut>" string
23 string const id_sc::shortcut(string const & idsc)
24 {
25         string sc = split(idsc, '|');
26         if (!sc.empty() && sc[0] == '#')
27                 sc.erase(sc.begin());
28         return sc;
29 }
30
31
32 /// Extract identifier from "<identifer>|#<shortcut>" string
33 string const id_sc::id(string const & idsc)
34 {
35         string id;
36         split(idsc, id, '|');
37         return id;
38 }