Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r54423 - in /trunk/core/libycp/src: YCPList.cc include/ycp/YCPList.h
  • From: aschnell@xxxxxxxxxxxxxxxx
  • Date: Wed, 07 Jan 2009 11:56:50 -0000
  • Message-id: <E1LKX1m-00050n-I3@xxxxxxxxxxxxxxxx>
Author: aschnell
Date: Wed Jan 7 12:56:50 2009
New Revision: 54423

URL: http://svn.opensuse.org/viewcvs/yast?rev=54423&view=rev
Log:
- added stuff required for back_insert_iterator<YCPList>

Modified:
trunk/core/libycp/src/YCPList.cc
trunk/core/libycp/src/include/ycp/YCPList.h

Modified: trunk/core/libycp/src/YCPList.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/YCPList.cc?rev=54423&r1=54422&r2=54423&view=diff
==============================================================================
--- trunk/core/libycp/src/YCPList.cc (original)
+++ trunk/core/libycp/src/YCPList.cc Wed Jan 7 12:56:50 2009
@@ -68,6 +68,13 @@


void
+YCPListRep::push_back(const YCPValue& value)
+{
+ elements.push_back(value);
+}
+
+
+void
YCPListRep::set (const int i, const YCPValue& value)
{
if (i < 0)

Modified: trunk/core/libycp/src/include/ycp/YCPList.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/include/ycp/YCPList.h?rev=54423&r1=54422&r2=54423&view=diff
==============================================================================
--- trunk/core/libycp/src/include/ycp/YCPList.h (original)
+++ trunk/core/libycp/src/include/ycp/YCPList.h Wed Jan 7 12:56:50 2009
@@ -93,6 +93,13 @@
void add(const YCPValue& value);

/**
+ * Appends a value to the list. Takes over the memory management
+ * of that value. Use @ref YCPElementRep, if you need it
+ * yourself.
+ */
+ void push_back(const YCPValue& value);
+
+ /**
* Sets a value in the list. Takes over the memory management
* of that value. Use @ref YCPElementRep, if you need it
* yourself.
@@ -229,6 +236,9 @@
typedef YCPListRep::YCPValueList::iterator iterator;
typedef YCPListRep::YCPValueList::const_iterator const_iterator;

+ typedef YCPListRep::YCPValueList::value_type value_type;
+ typedef YCPListRep::YCPValueList::const_reference const_reference;
+
YCPList() : YCPValue(new YCPListRep()) {}
YCPList(bytecodeistream & str);

@@ -236,6 +246,7 @@
void reserve (int size) { ELEMENT->reserve (size); }
bool isEmpty() const { return CONST_ELEMENT->isEmpty (); }
void add(const YCPValue& value) { ELEMENT->add (value); }
+ void push_back(const YCPValue& value) { ELEMENT->push_back(value); }
void set(const int n, const YCPValue& value) { ELEMENT->set (n, value); }
void remove(const int n) { ELEMENT->remove (n); }
void swap(int x, int y) { ELEMENT->swap (x, y); }

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages