2003-05-20 16:51:31 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-04-26 04:41:58 +00:00
|
|
|
* \file ErrorList.h
|
2003-05-20 16:51:31 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Alfredo Braunstein
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-05-20 16:51:31 +00:00
|
|
|
*/
|
|
|
|
|
2003-08-23 00:17:00 +00:00
|
|
|
#ifndef ERRORLIST_H
|
|
|
|
#define ERRORLIST_H
|
|
|
|
|
2016-10-09 19:34:12 +00:00
|
|
|
#include "TexRow.h"
|
|
|
|
|
2020-10-20 08:36:59 +00:00
|
|
|
#include "support/strfwd.h"
|
2004-03-24 17:06:17 +00:00
|
|
|
|
2003-05-20 16:51:31 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
2003-05-20 16:51:31 +00:00
|
|
|
class Buffer;
|
|
|
|
|
|
|
|
/// A class to hold an error item
|
2005-01-19 15:03:31 +00:00
|
|
|
class ErrorItem {
|
|
|
|
public:
|
2016-10-11 10:09:38 +00:00
|
|
|
typedef TexRow::TextEntry TextEntry;
|
2006-10-21 00:16:43 +00:00
|
|
|
docstring error;
|
|
|
|
docstring description;
|
2016-10-09 19:34:12 +00:00
|
|
|
// To generalise into RowEntries
|
|
|
|
TextEntry start;
|
|
|
|
TextEntry end;
|
2011-03-04 13:37:14 +00:00
|
|
|
Buffer const * buffer;
|
2016-10-09 19:34:12 +00:00
|
|
|
// With a start position and an end position
|
|
|
|
ErrorItem(docstring const & error, docstring const & description,
|
2016-10-11 10:09:38 +00:00
|
|
|
TextEntry start, TextEntry end, Buffer const * buf = 0);
|
2016-10-09 19:34:12 +00:00
|
|
|
// Error outside the document body
|
2006-10-21 00:16:43 +00:00
|
|
|
ErrorItem(docstring const & error, docstring const & description,
|
2016-10-09 19:34:12 +00:00
|
|
|
Buffer const * buf = 0);
|
2003-05-20 16:51:31 +00:00
|
|
|
ErrorItem();
|
|
|
|
};
|
|
|
|
|
2004-03-25 09:16:36 +00:00
|
|
|
|
2003-05-20 16:51:31 +00:00
|
|
|
class ErrorList : private std::vector<ErrorItem>
|
|
|
|
{
|
2003-09-09 18:27:24 +00:00
|
|
|
public:
|
2013-05-12 11:00:02 +00:00
|
|
|
ErrorList() : std::vector<ErrorItem> () {}
|
2003-05-20 16:51:31 +00:00
|
|
|
|
|
|
|
using std::vector<ErrorItem>::push_back;
|
|
|
|
using std::vector<ErrorItem>::end;
|
|
|
|
using std::vector<ErrorItem>::begin;
|
|
|
|
using std::vector<ErrorItem>::operator[];
|
|
|
|
using std::vector<ErrorItem>::size;
|
|
|
|
using std::vector<ErrorItem>::clear;
|
|
|
|
using std::vector<ErrorItem>::empty;
|
|
|
|
using std::vector<ErrorItem>::const_iterator;
|
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2003-05-20 16:51:31 +00:00
|
|
|
#endif
|