int SMO_getNodeSeries(SMOutputAPI* smoapi, int nodeIndex, SMO_nodeAttribute attr,
	int timeIndex, int length, float* outValueSeries)
//
//  Purpose: Get time series results for particular attribute. Specify series
//  start and length using timeIndex and length respectively.
//
{
	int k;

	if (smoapi->isOpened) 
	{
		// Check memory for outValues
		if (outValueSeries == NULL) return 411;

		// loop over and build time series
		for (k = 0; k < length; k++)
			outValueSeries[k] = getNodeValue(smoapi, timeIndex + k,
			nodeIndex, attr);

		return 0;
	}
	// Error no results to report on binary file not opened
	return 412;
}
Beispiel #2
0
 const stringT& getValue() const { return getNodeValue(); }
Beispiel #3
0
DOMString NodeImpl::toString()
{
    return DOMString("[")+getNodeName()+": "+getNodeValue()+"]";
    // return getNodeName();
};
Beispiel #4
0
void *getMap(Map map, string key) {
   BSTNode node;

   node = findBSTNode(map->bst, key);
   return (node == NULL) ? NULL : getNodeValue(node);
}
Beispiel #5
0
int parseXML(char *buf, char *status, char *ReturnMessage, char *errText) {
	xmlDocPtr document;
	xmlNodePtr root;
	xmlChar *clave;

	status[0] = '\0';
	errText[0] = '\0';

	while (buf[0] != '\0' && buf[0] != '<') {
		buf++;
	}

	if ((document = xmlParseMemory(buf, strlen(buf))) == NULL) {
		strcpy(errText, "ERROR: Bad document.");
		return -1;
	}

	if ((root = xmlDocGetRootElement(document)) == NULL) {
		xmlFreeDoc(document);
		strcpy(errText, "ERROR: Bad document. Root element not found.");
		return -1;
	}

    if (xmlStrcmp(root->name, (const xmlChar*) "sms-Response"))
    {
        xmlFreeDoc (document);
        strcpy(errText, "ERROR: Bad document. Node 'sms-Response' not found.");
        return -1;
    }

    clave = getNodeValue (document, root->xmlChildrenNode, "status");
    if (clave == NULL)
    {
        xmlFreeDoc (document);
        strcpy(errText, "ERROR: Bad document. Node 'status' not found.");
        return -1;
    }
    else
    {
        snprintf(status, 11, "%s", clave);
        trim(status);
    }

    clave = getNodeValue (document, root->xmlChildrenNode, "mensaje");
    if (clave == NULL)
    {
        xmlFreeDoc (document);
        strcpy(errText, "ERROR: Bad document. Node 'mensaje' not found.");
        return -1;
    }
    else
    {
        snprintf(ReturnMessage, 256, "%s", clave);
        trim(ReturnMessage);
    }

	xmlFree(clave);
	xmlFreeDoc(document);

	strcpy(errText, "");
	return 0;
}
Beispiel #6
0
void
Attr::removeIdRef() const
{
  if (isId())
    getOwnerDocument()->removeIdentifier(getNodeValue());
}
Beispiel #7
0
void
Attr::addIdRef() const
{
  if (isId())
    getOwnerDocument()->putIdentifier(getNodeValue(), getOwnerElement());
}
Beispiel #8
0
void
Attr::normalize()
{
  setNodeValue(getNodeValue());
}
Beispiel #9
0
vector<AbstractGui*> guiConstruct::guiTriangleConstruct(char* metadata_file, string NodeValue)
{
	vector<AbstractGui*> triangles;
	int index = 1; //for naming the elements

	ifstream metadata_stream ((char*)metadata_file, ios::in);
	if (metadata_stream == NULL)
	{
		return triangles;
	}

	char line[1000];
	metadata_stream.getline(line, 1000);
	
	while (!metadata_stream.eof())
	{
		string value = getNodeValue(line);
		if (value == NodeValue)
		{
			string str_metadata = getMetadata(line);


			int x1, y1;
			int x2, y2;
			int x3, y3;

			int position1 = 0;
			int position2 = str_metadata.find(",");
			x1 = capturedData;

			position1 = position2 + 1;
			position2 = str_metadata.find(",", position1);
			y1 = capturedData;

			position1 = position2 + 1;
			position2 = str_metadata.find(",", position1);
			x2 = capturedData;

			position1 = position2 + 1;
			position2 = str_metadata.find(",", position1);
			y2 = capturedData;

			position1 = position2 + 1;
			position2 = str_metadata.find(",", position1);
			x3 = capturedData;

			position1 = position2 + 1;
			y3 = atoi(str_metadata.substr(position2 + 1).data());

			Point* point_1 = new Point(x1, y1);
			Point* point_2 = new Point(x2, y2);
			Point* point_3 = new Point(x3, y3);

	
			Triangle* triangle = new Triangle(*point_1, *point_2, *point_3, index++);
			triangles.push_back(triangle);
		}
		memset(line,0,1000);
		metadata_stream.getline(line, 1000);
	}
	metadata_stream.close();

	return triangles;
}
bool DiagramItem::load (QDomNode* item)
{
    int ID;
    bool check;
    QString text;
    
    // restore ID
    ID = getNodeNumValue ( *item, QString ("ID"), &check);

    if (!check)
        return false;

    m_ID = ID;
    
    // restore text
    text = getNodeValue ( *item, QString ("Text"));
    m_strText = text;
    
    // restore brush
    QDomElement brush = item->firstChildElement(QString("Brush"));
    
    if (!brush.isNull())
    {
        // restore color
        QColor color;
        color.setNamedColor (getNodeValue (brush, QString("Color")));
        m_brush.setColor (color);
        
        // restore style
        int style = getNodeNumValue (brush, QString ("Style"), &check);
        
        if (check)
            m_brush.setStyle ((Qt::BrushStyle) style);
        
        changeBrush( m_brush);
    }
    
    // restore pen
    QDomElement pen = item->firstChildElement(QString("Pen"));
    
    if (!pen.isNull())
    {
        // restore color
        QColor color;
        color.setNamedColor (getNodeValue (pen, QString("Color")));
        m_pen.setColor(color);
        
        // restore style
        int style = getNodeNumValue (pen, QString ("Style"), &check);
        
        if (check)
            m_pen.setStyle ((Qt::PenStyle) style);
        
        // restore width
        int width = getNodeNumValue (pen, QString ("Width"), &check);
        
        if (check)
            m_pen.setWidth (width);
        
        changePen (m_pen);
    }
    
    return true;
}