On Wednesday 07 March 2001 18:08, Allan Rae wrote:
> On Wed, 7 Mar 2001, Angus Leeming wrote:
>
> > Does the fact that "boost::scoped_ptrs" etc are now appearing everywhere
mean
> > that we are now using namespaces officially and that I can write (for
> > example):
> >
> > namespace frontends {
> > namespace citation {
> > ...
> >
> > }
> > }
>
> You could but why would you need namespace citation?
> Just to bundle the view and controller sections?
> Seems a bit of overkill.
>
> Just the frontend namespace should be enough.
>
> Although, I think (instant thought -- just add water) that maybe a
> namespace frontend ... I don't know I've lost the thought now...
> maybe I just thought better of it. Maybe I'm tired. Maybe I'm turning
> into a Morlock. (I think I spelled that right -- and no I didn't mispell
> Worlock)
Don't go eating the idle and the beautiful. That's just not nice.
Actually, I think I'll hold on here (see André's comment). But my namespace
citation would contain (see below) together with the GUI-specific View.
Definitely enough to justify its own namespace, I think.
namespace citation {
class ControlCitation : public ControlCommand
{
public:
ControlCitation(LyXView &, Dialogs &);
/// A vector of bibliography keys
std::vector<string> const getBibkeys();
/** Returns the BibTeX data associated with a given key.
Empty if no info exists. */
string const getBibkeyInfo(string const &);
};
/** This class instantiates and makes available the GUI-specific
ButtonController and View.
*/
template <class GUIview, class GUIbc>
class GUICitation : public ControlCitation {
public:
GUICitation(LyXView &, Dialogs &);
virtual ButtonControllerBase & bc() { return bc_; }
virtual ViewBase & view() { return view_; }
};
/** Helper functions, of possible use to all frontends */
/** Multiple citation keys are stored in InsetCommandParams::contents as a
comma-separated string. These two functions convert to/from a vector. */
string const getStringFromVector(std::vector<string> const &);
std::vector<string> const getVectorFromString(string const &);
/** Search a BibTeX info field for the given key and return the
associated field. */
string const parseBibTeX(string data, string const & findkey);
}