Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

lyx Namespace Reference

wrap OS specific stuff. More...


Compounds

class  lyx::back_insert_fun_iterator
class  lyx::compare_memfun_t
class  lyx::const_back_insert_fun_iterator
class  lyx::const_compare_memfun_t
class  lyx::equal_1st_in_pair
class  lyx::equal_2nd_in_pair
struct  lyx::firster
struct  lyx::string::Srep
class  lyx::string
 A string class for LyX. More...


Typedefs

typedef time_t time_type
typedef std::vector< char
>::difference_type 
pos_type
 a type for positions used in paragraphs. More...

typedef std::vector< char
>::size_type 
size_type
 a type for sizes. More...

typedef std::vector< char
>::size_type 
textclass_type
 a type used for numbering text classes. More...


Enumerations

enum  word_location {
  WHOLE_WORD_STRICT, WHOLE_WORD, PARTIAL_WORD, PREVIOUS_WORD,
  NEXT_WORD
}

Functions

template<class For> bool sorted (For first, For last)
 Returns true if the sequence first,last is sorted, false if not. More...

template<class For, class Cmp> bool sorted (For first, For last, Cmp cmp)
 Cmp is the same Cmp as you would pass to std::sort. More...

template<class InputIter, class OutputIter, class Func> OutputIter copy_if (InputIter first, InputIter last, OutputIter result, Func func)
 copy elements in the given range to the output iterator if the predicate evaluates as true. More...

template<class Iterator, class T> std::iterator_traits< Iterator
>::difference_type 
count (Iterator first, Iterator last, T const &value)
 A slot in replacement for std::count for systems where it is broken. More...

template<class C> void eliminate_duplicates (C &c)
 Remove all duplicate entries in c. More...

template<class Cont, class Type, class MemRet> back_insert_fun_iterator<
Cont, Type, MemRet > 
back_inserter_fun (Cont &cont, MemRet(Type::*p)())
template<class R, class C, class A> compare_memfun_t< R, C, A > compare_memfun (R(C::*p)(), A const &a)
bool operator== (string const &a, string const &b)
bool operator== (string::value_type const *a, string const &b)
bool operator== (string const &a, string::value_type const *b)
bool operator!= (string const &a, string const &b)
bool operator!= (string::value_type const *a, string const &b)
bool operator!= (string const &a, string::value_type const *b)
bool operator> (string const &a, string const &b)
bool operator> (string::value_type const *a, string const &b)
bool operator> (string const &a, string::value_type const *b)
bool operator< (string const &a, string const &b)
bool operator< (string::value_type const *a, string const &b)
bool operator< (string const &a, string::value_type const *b)
bool operator>= (string const &a, string const &b)
bool operator>= (string::value_type const *a, string const &b)
bool operator>= (string const &a, string::value_type const *b)
bool operator<= (string const &a, string const &b)
bool operator<= (string::value_type const *a, string const &b)
bool operator<= (string const &a, string::value_type const *b)
string operator+ (string const &a, string const &b)
string operator+ (string::value_type const *a, string const &b)
string operator+ (string::value_type a, string const &b)
string operator+ (string const &a, string::value_type const *b)
string operator+ (string const &a, string::value_type b)
void swap (string &str1, string &str2)
istream & operator>> (istream &is, string &s)
ostream & operator<< (ostream &o, string const &s)
istream & getline (istream &is, string &s, string::value_type delim)
string operator+ (char const *a, string const &b)
time_type current_time ()


Detailed Description

wrap OS specific stuff.

Typedef Documentation

typedef std::vector<char>::difference_type lyx::pos_type
 

a type for positions used in paragraphs.

Definition at line 27 of file types.h.

Referenced by Paragraph::Pimpl::acceptChange, Paragraph::acceptChange, addressBreakPoint, MathCursor::adjust, LyXText::appendParagraph, Buffer::asciiParagraph, Paragraph::asString, LyXText::backspace, Paragraph::beginningOfBody, bibitemWidest, LyXText::breakAgain, LyXText::breakAgainOneRow, breakParagraph, breakParagraphConservative, LyXText::changeCase, Paragraph::changeLanguage, LyXText::checkParagraph, LyXText::computeBidiTables, Changes::Range::contains, Paragraph::copyIntoMinibuffer, InsetText::cpos, LyXText::cursorEnd, cursorRightOneWord, Paragraph::cutIntoMinibuffer, InsetList::decreasePosAfterPos, RefInset::dispatch, MathScriptInset::dispatch, MathNestInset::dispatch, MathHullInset::dispatch, MathGridInset::dispatch, InsetBase::dispatch, CommandInset::dispatch, MathHullInset::doExtern, MathTextInset::drawSelection, MathNestInset::drawSelection, MathInset::drawSelection, Paragraph::Pimpl::erase, Paragraph::erase, InsetList::erase, Changes::erase, Paragraph::Pimpl::eraseIntern, LyXText::fill, InsetList::get, Paragraph::Pimpl::getChar, Paragraph::getChar, LyXText::getColumnNearX, LyXText::getCursorX, LyXText::getFont, RowPainter::getFont, Paragraph::getFont, Paragraph::getFontSettings, LyXText::getInset, Paragraph::getInset, MathTextInset::getPos, MathNestInset::getPos, MathInset::getPos, LyXText::getRow, Paragraph::getUChar, LyXText::gotoNextInset, hfillExpansion, Paragraph::highestFontInRange, MathNestInset::idxEnd, MathInset::idxEnd, MathGridInset::idxEnd, MathScriptInset::idxFirst, MathNestInset::idxFirst, MathInset::idxFirst, MathHullInset::idxFirst, MathGridInset::idxFirst, MathNestInset::idxHome, MathInset::idxHome, MathGridInset::idxHome, MathScriptInset::idxLast, MathNestInset::idxLast, MathInset::idxLast, MathHullInset::idxLast, MathGridInset::idxLast, MathScriptInset::idxLeft, MathNestInset::idxLeft, MathMacro::idxLeft, MathInset::idxLeft, MathGridInset::idxLeft, MathFracbaseInset::idxLeft, MathNestInset::idxNext, MathInset::idxNext, MathNestInset::idxPrev, MathInset::idxPrev, MathScriptInset::idxRight, MathNestInset::idxRight, MathMacro::idxRight, MathInset::idxRight, MathGridInset::idxRight, MathFracbaseInset::idxRight, MathScriptInset::idxUpDown, MathRootInset::idxUpDown, MathMacro::idxUpDown, MathInset::idxUpDown, MathGridInset::idxUpDown, MathFracbaseInset::idxUpDown, MathTextInset::idxUpDown2, MathInset::idxUpDown2, InsetList::increasePosAfterPos, LyXText::insertChar, Paragraph::Pimpl::insertChar, Paragraph::insertChar, Paragraph::insertFromMinibuffer, Paragraph::Pimpl::insertInset, Paragraph::insertInset, LyXText::insertStringAsLines, Buffer::insertStringAsLines, InsetList::insetIterator, LyXText::isBoundary, Changes::isChange, Paragraph::Pimpl::isChanged, Paragraph::isChanged, Paragraph::Pimpl::isChangeEdited, Paragraph::isChangeEdited, Paragraph::isHfill, isInsertedText, Paragraph::isInset, Paragraph::isKomma, Paragraph::isLetter, Paragraph::isLineSeparator, Paragraph::isNewline, Paragraph::isSeparator, Paragraph::Pimpl::isTextAt, Paragraph::isWord, LyXText::labelFill, lastPos, lastPrintablePos, Changes::lookup, Paragraph::Pimpl::lookupChange, Paragraph::Pimpl::lookupChangeFull, Changes::lookupFull, Changes::Range::loose_contains, LyXText::makeFontEntriesLayoutSpecific, MathArray::matchpart, mergeParagraph, nextRowIsAllInset, numberOfHfills, numberOfLabelHfills, numberOfSeparators, MathArray::operator[], RowPainter::paintArabicComposeChar, RowPainter::paintChangeBar, RowPainter::paintChars, RowPainter::paintFromPos, RowPainter::paintHebrewComposeChar, RowPainter::paintInset, RowPainter::paintLast, RowPainter::paintSelection, RowPainter::paintText, Row::pos, MathTextInset::pos2row, LyXText::prepareToPrint, Changes::record, Paragraph::Pimpl::rejectChange, Paragraph::rejectChange, InsetList::release, LyXText::replaceSelectionWithString, BufferView::Pimpl::resizeCurrentBuffer, Row::Row, LyXText::rowBreakPoint, LyXText::selectNextWordToSpellcheck, Changes::set, Paragraph::Pimpl::setChange, Paragraph::Pimpl::setChar, Paragraph::setChar, LyXText::setCharFont, LyXText::setCurrentFont, LyXText::setCursor, LyXText::setCursorFromCoordinates, LyXText::setCursorIntern, Paragraph::setFont, LyXText::setHeightOfRow, Buffer::simpleDocBookOnePar, Buffer::simpleLinuxDocOnePar, Paragraph::Pimpl::simpleTeXBlanks, Paragraph::simpleTeXOnePar, Paragraph::Pimpl::simpleTeXSpecialChars, LyXText::singleWidth, MathGridInset::splitCell, LyXText::transformChar, transposeChars, Paragraph::Pimpl::validate, LyXText::workWidth, and Paragraph::write.

typedef std::vector<char>::size_type lyx::size_type
 

a type for sizes.

Definition at line 34 of file types.h.

typedef std::vector<char>::size_type lyx::textclass_type
 

a type used for numbering text classes.

Definition at line 38 of file types.h.

Referenced by LyXTextClassList::NumberOfClass, and LyXTextClassList::operator[].

typedef time_t lyx::time_type
 

Definition at line 19 of file lyxtime.h.


Enumeration Type Documentation

enum lyx::word_location
 

Enumeration values:
WHOLE_WORD_STRICT 
WHOLE_WORD 
PARTIAL_WORD  the word begining from the cursor position.
PREVIOUS_WORD  the word around the cursor or before the cursor.
NEXT_WORD  the next word (not yet used).

Definition at line 74 of file types.h.

Referenced by getWord, LyXText::selectWord, and LyXText::selectWordWhenUnderCursor.

00074                            {
00075                 // the word around the cursor, only if the cursor is
00076                 //not at a boundary
00077                 WHOLE_WORD_STRICT,
00078                 // the word around the cursor
00079                 WHOLE_WORD,
00081                 PARTIAL_WORD,
00083                 PREVIOUS_WORD,
00085                 NEXT_WORD
00086         };


Function Documentation

template<class Cont, class Type, class MemRet>
const_back_insert_fun_iterator< Cont, Type, MemRet > lyx::back_inserter_fun Cont &    cont,
MemRet(Type::*    p)()
 

Definition at line 109 of file lyxfunctional.h.

Referenced by BufferList::getFileNames.

00110 {
00111         return back_insert_fun_iterator<Cont, Type, MemRet>(cont, p);
00112 }

template<class R, class C, class A>
const_compare_memfun_t< R, C, A > lyx::compare_memfun R(C::*    p)(),
A const &    a
 

Definition at line 159 of file lyxfunctional.h.

Referenced by Formats::add, Formats::erase, BufferList::exists, BufferList::getBuffer, lyx::support::ForkedcallsController::getCommand, Formats::getFormat, BufferView::Pimpl::getInsetByCode, MenuBackend::getMenu, Formats::getNumber, lyx::support::ForkedcallsController::kill, LyXTextClassList::NumberOfClass, and Formats::setViewer.

00160 {
00161         return compare_memfun_t<R, C, A>(p, a);
00162 }

template<class InputIter, class OutputIter, class Func>
OutputIter copy_if InputIter    first,
InputIter    last,
OutputIter    result,
Func    func
 

copy elements in the given range to the output iterator if the predicate evaluates as true.

Definition at line 65 of file lyxalgo.h.

Referenced by ControlCommandBuffer::completions.

00067 {
00068         for (; first != last; ++first) {
00069                 if (func(*first)) {
00070                         *result++ = *first;
00071                 }
00072         }
00073         return result;
00074 }

template<class Iterator, class T>
std::iterator_traits<Iterator>::difference_type count Iterator    first,
Iterator    last,
T const &    value
 

A slot in replacement for std::count for systems where it is broken.

Definition at line 80 of file lyxalgo.h.

Referenced by InsetText::ascii, BufferView::ChangeRefsIfUnique, Menubar::Pimpl::create_submenu, Paragraph::Pimpl::erase, get_matching_brace, get_matching_brace_back, getTexFileFromList, LyXFont::latexWriteEndChanges, LyXFont::latexWriteStartChanges, Parser::parse1, LaTeX::run, runMessage, LaTeX::scanLogFile, and QCitationDialog::setButtons.

00081 {
00082 #ifdef HAVE_STD_COUNT
00083         return std::count(first, last, value);
00084 #else
00085         std::iterator_traits<Iterator>::difference_type n = 0;
00086         while (first != last)
00087                 if (*first++ == value) ++n;
00088         return n;
00089 #endif
00090 }

time_type lyx::current_time  
 

Definition at line 17 of file lyxtime.C.

Referenced by DepTable::update.

00018 {
00019         return time(0);
00020 }

template<class C>
void eliminate_duplicates C &    c
 

Remove all duplicate entries in c.

Definition at line 94 of file lyxalgo.h.

Referenced by getTexFileList, and unique_and_no_extensions.

00095 {
00096         C unique_c;
00097         std::set<typename C::value_type> s;
00098 
00099         for (typename C::iterator p = c.begin(); p != c.end(); ++p) {
00100                 if (s.find(*p) == s.end()) {
00101                         unique_c.push_back(*p);
00102                         s.insert(*p);
00103                 }
00104         }
00105         swap(c, unique_c);
00106 }

std::istream & lyx::getline std::istream &   ,
string   s,
string::value_type    delim = '\n'
 

Definition at line 1776 of file lyxstring.C.

Referenced by QAbout::build_dialog, clean_layouts, LaTeX::deplog, InsetBibtex::fillWithBibKeys, CVS::find_file, initAutoCorrect, initSymbols, l_getline, CharacterSet::loadFile, MathArrayInset::MathArrayInset, LyXLex::Pimpl::next, operator>>, pipeThroughMaple, pipeThroughMaxima, pipeThroughOctave, DepTable::read, LastFiles::readFile, readParToken, LaTeX::scanAuxFile, LaTeX::scanLogFile, Chktex::scanLogFile, CVS::scanMaster, and split.

01778 {
01779         // very bad solution
01780         char tmp = 0;
01781         s.erase();
01782         while (is) {
01783                 is.get(tmp);
01784                 if (tmp != delim) {
01785                         s += tmp;
01786                 } else {
01787                         break;
01788                 }
01789         }
01790         return is;
01791 }

bool lyx::operator!= string const &    a,
string::value_type const *    b
 

Definition at line 1601 of file lyxstring.C.

01602 {
01603         Assert(b); // OURS!
01604         return a.compare(b) != 0;
01605 }

bool lyx::operator!= string::value_type const *    a,
string const &    b
 

Definition at line 1594 of file lyxstring.C.

01595 {
01596         Assert(a); // OURS!
01597         return b.compare(a) != 0;
01598 }

bool lyx::operator!= string const &    a,
string const &    b
 

Definition at line 1588 of file lyxstring.C.

01589 {
01590         return a.compare(b) != 0;
01591 }

string operator+ char const *    a,
string const &    b
 

string lyx::operator+ string const &    a,
string::value_type    b
 

Definition at line 1723 of file lyxstring.C.

01724 {
01725         string tmp(a);
01726         tmp += b;
01727         return tmp;
01728 }

string lyx::operator+ string const &    a,
string::value_type const *    b
 

Definition at line 1714 of file lyxstring.C.

01715 {
01716         Assert(b); // OURS!
01717         string tmp(a);
01718         tmp += b;
01719         return tmp;
01720 }

string lyx::operator+ string::value_type    a,
string const &    b
 

Definition at line 1705 of file lyxstring.C.

01706 {
01707         string tmp;
01708         tmp += a;
01709         tmp += b;
01710         return tmp;
01711 }

string operator+ string::value_type const *    a,
string const &    b
 

Definition at line 1696 of file lyxstring.C.

01697 {
01698         Assert(a); // OURS!
01699         string tmp(a);
01700         tmp += b;
01701         return tmp;
01702 }

string lyx::operator+ string const &    a,
string const &    b
 

Definition at line 1688 of file lyxstring.C.

01689 {
01690         string tmp(a);
01691         tmp += b;
01692         return tmp;
01693 }

bool lyx::operator< string const &    a,
string::value_type const *    b
 

Definition at line 1641 of file lyxstring.C.

01642 {
01643         Assert(b); // OURS!
01644         return a.compare(b) < 0;
01645 }

bool lyx::operator< string::value_type const *    a,
string const &    b
 

Definition at line 1634 of file lyxstring.C.

01635 {
01636         Assert(a); // OURS!
01637         return b.compare(a) > 0; // since we reverse the parameters
01638 }

bool lyx::operator< string const &    a,
string const &    b
 

Definition at line 1628 of file lyxstring.C.

01629 {
01630         return a.compare(b) < 0;
01631 }

std::ostream & lyx::operator<< std::ostream &   ,
string const &    s
 

Definition at line 1770 of file lyxstring.C.

01771 {
01772         return o.write(s.data(), s.length());
01773 }

bool lyx::operator<= string const &    a,
string::value_type const *    b
 

Definition at line 1681 of file lyxstring.C.

01682 {
01683         Assert(b); // OURS!
01684         return a.compare(b) <= 0;
01685 }

bool lyx::operator<= string::value_type const *    a,
string const &    b
 

Definition at line 1674 of file lyxstring.C.

01675 {
01676         Assert(a); // OURS!
01677         return b.compare(a) >= 0; // since we reverse the parameters
01678 }

bool lyx::operator<= string const &    a,
string const &    b
 

Definition at line 1668 of file lyxstring.C.

01669 {
01670         return a.compare(b) <= 0;
01671 }

bool lyx::operator== string const &    a,
string::value_type const *    b
 

Definition at line 1581 of file lyxstring.C.

01582 {
01583         Assert(b); // OURS!
01584         return a.compare(b) == 0;
01585 }

bool lyx::operator== string::value_type const *    a,
string const &    b
 

Definition at line 1574 of file lyxstring.C.

01575 {
01576         Assert(a); // OURS!
01577         return b.compare(a) == 0;
01578 }

bool lyx::operator== string const &    a,
string const &    b
 

Definition at line 1568 of file lyxstring.C.

01569 {
01570         return a.compare(b) == 0;
01571 }

bool lyx::operator> string const &    a,
string::value_type const *    b
 

Definition at line 1621 of file lyxstring.C.

01622 {
01623         Assert(b); // OURS!
01624         return a.compare(b) > 0;
01625 }

bool lyx::operator> string::value_type const *    a,
string const &    b
 

Definition at line 1614 of file lyxstring.C.

01615 {
01616         Assert(a); // OURS!
01617         return b.compare(a) < 0; // since we reverse the parameters
01618 }

bool lyx::operator> string const &    a,
string const &    b
 

Definition at line 1608 of file lyxstring.C.

01609 {
01610         return a.compare(b) > 0;
01611 }

bool lyx::operator>= string const &    a,
string::value_type const *    b
 

Definition at line 1661 of file lyxstring.C.

01662 {
01663         Assert(b); // OURS!
01664         return a.compare(b) >= 0;
01665 }

bool lyx::operator>= string::value_type const *    a,
string const &    b
 

Definition at line 1654 of file lyxstring.C.

01655 {
01656         Assert(a); // OURS!
01657         return b.compare(a) <= 0; // since we reverse the parameters
01658 }

bool lyx::operator>= string const &    a,
string const &    b
 

Definition at line 1648 of file lyxstring.C.

01649 {
01650         return a.compare(b) >= 0;
01651 }

std::istream & lyx::operator>> std::istream &   ,
string   s
 

Definition at line 1737 of file lyxstring.C.

01738 {
01739 #if 0
01740         // very bad solution
01741         char * nome = new char[1024];
01742         is >> nome;
01743         string tmp(nome);
01744         delete [] nome;
01745         if (!tmp.empty()) s = tmp;
01746 #else
01747         // better solution
01748         int w = is.width(0);
01749         s.clear();
01750         char c = 0;
01751         bool skipspace = true;
01752         while (is.get(c)) {
01753                 if (isspace(c)) {
01754                         if (!skipspace) {
01755                                 is.putback(c);
01756                                 break;
01757                         }
01758                 } else {
01759                         s += c;
01760                         skipspace = false;
01761                 }
01762                 if (--w == 1) break;
01763         }
01764         if (s.empty()) is.setstate(std::ios::failbit);
01765 #endif
01766         return is;
01767 }

template<class For, class Cmp>
bool sorted For    first,
For    last,
Cmp    cmp
 

Cmp is the same Cmp as you would pass to std::sort.

Definition at line 41 of file lyxalgo.h.

00042 {
00043         if (first == last) return true;
00044         For tmp = first;
00045         while (++tmp != last) {
00046                 if (cmp(*tmp, *first++)) return false;
00047         }
00048         return true;
00049 }

template<class For>
bool sorted For    first,
For    last
 

Returns true if the sequence first,last is sorted, false if not.

Definition at line 28 of file lyxalgo.h.

Referenced by LyXLex::Pimpl::verifyTable.

00029 {
00030         if (first == last) return true;
00031         For tmp = first;
00032         while (++tmp != last) {
00033                 if (*tmp < *first++) return false;
00034         }
00035         return true;
00036 }

void lyx::swap string   s1,
string   s2
 

Definition at line 1731 of file lyxstring.C.

Referenced by MathGridInset::addCol, InsetTabular::copySelection, InsetTabular::cutSelection, MathGridInset::delCol, InsetTabular::drawCellSelection, InsetTabular::getSelection, region, MathGridInset::swapCol, MathGridInset::swapRow, and InsetERT::updateStatus.

01732 {
01733         str1.swap(str2);
01734 }


Generated on Fri Jul 18 01:19:06 2003 for lyx by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002