//==============================================================================
XmlElement* PaintElementPath::createXml() const
{
    XmlElement* e = new XmlElement (getTagName());
    position.applyToXml (*e);
    addColourAttributes (e);
    e->setAttribute ("nonZeroWinding", nonZeroWinding);
    e->addTextElement (pathToString());

    return e;
}
std::ostream& ossimNitfCsccgaTag::print(std::ostream& out,
                                        const std::string& prefix) const
{
   std::string pfx = prefix;
   pfx += getTagName();
   pfx += ".";
   out << setiosflags(ios::left)
       << pfx << std::setw(24) << "CETAG:"      << getTagName() << "\n"
       << pfx << std::setw(24) << "CEL:"        << getTagLength() << "\n"
       << pfx << std::setw(24) << "CCG_SOURCE:" << m_ccgSource << "\n"
       << pfx << std::setw(24) << "CCG_SOURCE:" << m_regSensor << "\n"
       << pfx << std::setw(24) << "ORIGIN_LINE:" << m_originLine << "\n"
       << pfx << std::setw(24) << "ORIGIN_SAMPLE:" << m_originSample << "\n"
       << pfx << std::setw(24) << "AS_CELL_SIZE:" << m_asCellSize << "\n"
       << pfx << std::setw(24) << "CS_CELL_SIZE:" << m_csCellSize << "\n"
       << pfx << std::setw(24) << "CCG_MAX_LINE:" << m_ccgMaxLine << "\n"
       << pfx << std::setw(24) << "CCG_MAX_SAMPLE:" << m_ccgMaxSample << "\n";


   return out;
}
Exemple #3
0
std::string ExplorerElement::toString() {

	char ach[200];
	sprintf (ach, " %p->%p ( %s )", this, m_pElement, m_internalId.c_str());
	std::string s = "ExplorerElement ";

	std::string tag;
	getTagName(tag);
	s += tag;
	s += ach;
	return s;
}
Exemple #4
0
void XUIObject::destroyChild(XUIObject *child) {
  int pos = m_children.searchItem(child);
  if (pos < 0) return;
  m_children.removeByPos(pos);
  svc_xuiObject *svc = child->getOwnerService();
  if (svc == NULL) {
    DebugString("Owner service is NULL for XUIObject %s", getTagName());
  } else {
    svc->destroy(child);
  }
  reflow();
}
void write(TextStream& ts, const RenderPath& path, int indent)
{
    writeIndent(ts, indent);
    ts << path.renderName();

    if (path.element()) {
        String tagName = getTagName(static_cast<SVGStyledElement*>(path.element()));
        if (!tagName.isEmpty())
            ts << " {" << tagName << "}";
    }

    ts << path << "\n";
}
Exemple #6
0
void write(TextStream &ts, const RenderPath &path, int indent)
{
    writeIndent(ts, indent);
    ts << path.renderName();
    
    if (path.element()) {
        DeprecatedString tagName = getTagName(path.element());
        if (!tagName.isEmpty())
            ts << " {" << tagName << "}";
    }
    
    ts << path << endl;
}
std::ostream& rspfNitfIchipbTag::print(std::ostream& out,
                                        const std::string& prefix) const
{
   std::string pfx = prefix;
   pfx += getTagName();
   pfx += ".";

   out << setiosflags(std::ios::left)
       << pfx << std::setw(24) << "CETAG:"
       << getTagName() << "\n"
       << pfx << std::setw(24) << "CEL:"
       << getTagLength() << "\n"
       << pfx << std::setw(24) << "XFRM_FLAG:"     << theXfrmFlag << "\n"
       << pfx << std::setw(24) << "SCALE_FACTOR:"  << theScaleFactor << "\n"
       << pfx << std::setw(24) << "ANAMRPH_CORR:"  << theAnamrphCorr << "\n"
       << pfx << std::setw(24) << "SCANBLK_NUM:"   << theScanBlock << "\n"
       << pfx << std::setw(24) << "OP_ROW_11:"     << theOpRow11 << "\n"
       << pfx << std::setw(24) << "OP_COL_11:"     << theOpCol11 << "\n"
       << pfx << std::setw(24) << "OP_ROW_12:"     << theOpRow12 << "\n"
       << pfx << std::setw(24) << "OP_COL_12:"     << theOpCol12 << "\n"
       << pfx << std::setw(24) << "OP_ROW_21:"     << theOpRow21 << "\n"
       << pfx << std::setw(24) << "OP_COL_21:"     << theOpCol21 << "\n"
       << pfx << std::setw(24) << "OP_ROW_22:"     << theOpRow22 << "\n"
       << pfx << std::setw(24) << "OP_COL_22:"     << theOpCol22 << "\n"
       << pfx << std::setw(24) << "FI_ROW_11:"     << theFiRow11 << "\n"
       << pfx << std::setw(24) << "FI_COL_11:"     << theFiCol11 << "\n"
       << pfx << std::setw(24) << "FI_ROW_12:"     << theFiRow12 << "\n"
       << pfx << std::setw(24) << "FI_COL_12:"     << theFiCol12 << "\n"
       << pfx << std::setw(24) << "FI_ROW_21:"     << theFiRow21 << "\n"
       << pfx << std::setw(24) << "FI_COL_21:"     << theFiCol21 << "\n"
       << pfx << std::setw(24) << "FI_ROW_22:"     << theFiRow22 << "\n"
       << pfx << std::setw(24) << "FI_COL_22:"     << theFiCol22 << "\n"
       << pfx << std::setw(24) << "FI_ROW:"        << theFullImageRow << "\n"
       << pfx << std::setw(24) << "FI_COL:"        << theFullImageCol
       << std::endl;

   return out;
}
std::ostream& ossimNitfSensraTag::print(
   std::ostream& out, const std::string& prefix) const
{
   std::string pfx = prefix;
   pfx += getTagName();
   pfx += ".";
   
   out << std::setiosflags(std::ios::left)
       << pfx << std::setw(24) << "CETAG:"
       << getTagName() << "\n"
       << pfx << std::setw(24) << "CEL:" << getTagLength() << "\n"
       << pfx << std::setw(24) << "REFROW:" << theRefRow << "\n"
       << pfx << std::setw(24) << "REFCOL:" << theRefCol << "\n"
       << pfx << std::setw(24) << "SENSORMODEL:" << theSensorModel<< "\n"
       << pfx << std::setw(24) << "SENSORMOUNT:" << theSensorMount << "\n"
       << pfx << std::setw(24) << "SENSORLOC:" << theSensorLoc << "\n"
       << pfx << std::setw(24) << "SENSORALTSRC:" << theSensorAltSrc<< "\n"
       << pfx << std::setw(24) << "SENSORALT:" << theSensorAlt << "\n"
       << pfx << std::setw(24) << "SENSORALTUNIT:" << theSensorAltUnit << "\n"
       << pfx << std::setw(24) << "SENSORAGL:" << theSensorAgl << "\n"
       << pfx << std::setw(24) << "SENSORPITCH:" << theSensorPitch << "\n"
       << pfx << std::setw(24) << "SENSORROLL:" << theSensorRoll<< "\n"
       << pfx << std::setw(24) << "SENSORYAW:" << theSensorYaw << "\n"
       << pfx << std::setw(24) << "PLATFORMPITCH:" << thePlatformPitch << "\n"
       << pfx << std::setw(24) << "PLATFORMROLL:" << thePlatformRoll << "\n"
       << pfx << std::setw(24) << "PLATFORMHDG:" << thePlatformHdg << "\n"
       << pfx << std::setw(24) << "GROUNDSPDSRC:" << theGroundSpdSrc << "\n"
       << pfx << std::setw(24) << "GROUNDSPEED:" << theGroundSpeed << "\n"
       << pfx << std::setw(24) << "GROUNDSPDUNIT:" << theGroundSpdUnit << "\n"
       << pfx << std::setw(24) << "GROUNDTRACK:" << theGroundTrack << "\n"
       << pfx << std::setw(24) << "VERTICALVEL:" << theVerticalVel<< "\n"
       << pfx << std::setw(24) << "VERTVELUNIT:" << theVertVelUnit << "\n"
       << pfx << std::setw(24) << "SWATHFRAMES:" << theSwathFrames<< "\n"
       << pfx << std::setw(24) << "NSWATHS:" << theNSwaths << "\n"
       << pfx << std::setw(24) << "SPOTNUM:" << theSpotNum << "\n";
   
   return out;
}
std::ostream& ossimNitfBlockaTag::print(std::ostream& out,
                                        const std::string& prefix) const
{
    std::string pfx = prefix;
    pfx += getTagName();
    pfx += ".";

    // Grab the corners parsed into points.
    ossimDpt ulPt;
    ossimDpt urPt;
    ossimDpt lrPt;
    ossimDpt llPt;
    getFrfcLoc(ulPt);
    getFrlcLoc(urPt);
    getLrlcLoc(lrPt);
    getLrfcLoc(llPt);

    out << setiosflags(ios::left)
        << pfx << std::setw(24) << "CETAG:" << getTagName() << "\n"
        << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
        << pfx << std::setw(24) << "BLOCK_INSTANCE:" << theBlockInstance << "\n"
        << pfx << std::setw(24) << "N_GRAY:"         << theNGray << "\n"
        << pfx << std::setw(24) << "L_LINES:"        << theLLines << "\n"
        << pfx << std::setw(24) << "LAYOVER_ANGLE:"  << theLayoverAngle << "\n"
        << pfx << std::setw(24) << "SHADOW_ANGLE:"   << theShadowAngle << "\n"
        << pfx << std::setw(24) << "FIELD_6:"        << theField6 << "\n"
        << pfx << std::setw(24) << "FRLC_LOC:"       << theFrlcLoc << "\n"
        << pfx << std::setw(24) << "LRLC_LOC:"       << theLrlcLoc << "\n"
        << pfx << std::setw(24) << "LRFC_LOC:"       << theLrfcLoc << "\n"
        << pfx << std::setw(24) << "FRFC_LOC:"       << theFrfcLoc << "\n"
        << pfx << std::setw(24) << "FIELD_11:"       << theField11 << "\n"
        << pfx << std::setw(24) << "upper left:"     << ulPt << "\n"
        << pfx << std::setw(24) << "upper right:"    << urPt << "\n"
        << pfx << std::setw(24) << "lower right:"    << lrPt << "\n"
        << pfx << std::setw(24) << "lower left:"     << llPt << "\n";

    return out;
}
std::ostream& ossimNitfExoptaTag::print(std::ostream& out,
  const std::string& prefix )const
{
   std::string pfx = prefix;
   pfx += getTagName();
   pfx += ".";
   out << setiosflags(ios::left)
       << pfx << std::setw(24) << "CETAG:"      << getTagName() << "\n"
       << pfx << std::setw(24) << "CEL:"        << getTagLength() << "\n"
       << pfx << std::setw(24) << "ANGLE_TO_NORTH:"        << m_angleToNorth<< "\n"
       << pfx << std::setw(24) << "DYNAMIC_RANGE:"        << m_dynamicRange<< "\n"
       << pfx << std::setw(24) << "OBL_ANG:"        << m_oblAng<< "\n"
       << pfx << std::setw(24) << "ROLL_ANG:"        << m_rollAng<< "\n"
       << pfx << std::setw(24) << "PRIME_ID:"        << m_primeId<< "\n"
       << pfx << std::setw(24) << "PRIME_BE:"        << m_primeBe<< "\n"
       << pfx << std::setw(24) << "N_SEC"        << m_nSec<< "\n"
       << pfx << std::setw(24) << "N_SEG:"        << m_nSeg<< "\n"
       << pfx << std::setw(24) << "MAX_LP_SEG:"        << m_maxLpSeg<< "\n"
       << pfx << std::setw(24) << "SUN_EL:"        << m_sunEl<< "\n"
       << pfx << std::setw(24) << "SUN_AZ:"        << m_sunAz<< "\n";
   
   return out;
}
std::ostream& ossimNitfUnknownTag::print(std::ostream& out,
                                         const std::string& prefix) const
{
   std::string pfx = prefix;
   pfx += getTagName();
   pfx += ".";

   out << setiosflags(std::ios::left)
       << pfx << std::setw(24) << "CETAG:" << getTagName() << "\n"
       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
       << pfx << std::setw(24) << "unformatted_tag_data: ";
   
   if (tagDataIsAscii())
   {
      out << m_tagData << "\n";
   }
   else
   {
      out << "binary not displayed\n";
   }
   
   return out;
}
void write(TextStream& ts, const RenderSVGInlineText& text, int indent)
{
    writeIndent(ts, indent);
    ts << text.renderName();

    if (text.element()) {
        String tagName = getTagName(static_cast<SVGStyledElement*>(text.element()));
        if (!tagName.isEmpty())
            ts << " {" << tagName << "}";
    }

    ts << " at (" << text.xPos() << "," << text.yPos() << ") size " << text.width() << "x" << text.height() << "\n";
    writeSVGInlineText(ts, text, indent);
}
Exemple #13
0
void XUIObject::destroyChildren(PtrList<XUIObject> *deletelist) {
  foreach(*deletelist)
    XUIObject *child = deletelist->getfor();
    int pos = m_children.searchItem(child);
    if (pos < 0) return;
    m_children.removeByPos(pos);
    svc_xuiObject *svc = child->getOwnerService();
    if (svc == NULL) {
      DebugString("Owner service is NULL for XUIObject %s", getTagName());
    } else {
      svc->destroy(child);
    }
  endfor;
  reflow();
}
Exemple #14
0
void stackInOut(bufferarray *block, char* loc, Bcstype bt, stack* st, bcs* r){
    char *str = (char*)malloc(NAMELEN * sizeof(char));
    strcpy(str, getTagName(str, loc, bt));
    if(st->top>-1 && strcmp(str, st->data[st->top]->tagname) == 0){
        //printf("块号:%d\t出栈前\t栈顶元素:%s\t栈内元素个数%d\n", block->bufnum, st->data[st->top]->tagname, st->top+1);
        lable *delnode = Pop(st);
        free(delnode);
        free(str);
    }else{
        if(str[0] == '\0')  return;
        lable* node = creatData(str, bt);
        Push(st, node);
        //printf("块号:%d\t入栈后\t栈顶元素:%s\t栈内元素个数%d\n", block->bufnum, str,st->top+1);
    }
}
Exemple #15
0
/// Load parameter value from XML.
///
/// @param xmlDocument XML document to load from
///
void ParString::loadFromXml(XmlElement *xmlDocument)
{
    // get parameter's element from XML document
    XmlElement *xmlParameter = xmlDocument->getChildByName(getTagName());

    // parameter's element found
    if (xmlParameter)
    {
        // get stored value from attribute "value" (or use empty string)
        String newValue = xmlParameter->getStringAttribute("value", String());

        // update value
        setText(newValue);
    }
}
Exemple #16
0
bool PaintElementPath::loadFromXml (const XmlElement& xml)
{
    if (xml.hasTagName (getTagName()))
    {
        position.restoreFromXml (xml, position);
        loadColourAttributes (xml);
        nonZeroWinding = xml.getBoolAttribute ("nonZeroWinding", true);

        restorePathFromString (xml.getAllSubText().trim());

        return true;
    }

    jassertfalse;
    return false;
}
void write(TextStream& ts, const RenderSVGText& text, int indent)
{
    writeIndent(ts, indent);
    ts << text.renderName();

    if (text.element()) {
        String tagName = getTagName(static_cast<SVGStyledElement*>(text.element()));
        if (!tagName.isEmpty())
            ts << " {" << tagName << "}";
    }

    ts << text << "\n";

    for (RenderObject* child = text.firstChild(); child; child = child->nextSibling())
        write(ts, *child, indent + 1);
}
Exemple #18
0
/// Store parameter value as XML.
///
/// @param xmlDocument XML document to store in
///
void ParString::storeAsXml(XmlElement *xmlDocument)
{
    // create new XML element with parameter's tag name (will be
    // deleted by XML document)
    XmlElement *xmlParameter = new XmlElement(getTagName());

    // XML element was successfully created
    if (xmlParameter)
    {
        // set attribute "value" to current value
        xmlParameter->setAttribute("value", getText());

        // add new element to XML document
        xmlDocument->addChildElement(xmlParameter);
    }
}
Exemple #19
0
void write(TextStream &ts, const RenderSVGContainer &container, int indent)
{
    writeIndent(ts, indent);
    ts << container.renderName();
    
    if (container.element()) {
        DeprecatedString tagName = getTagName(container.element());
        if (!tagName.isEmpty())
            ts << " {" << tagName << "}";
    }
    
    ts << container << endl;
    
    for (RenderObject *child = container.firstChild(); child != NULL; child = child->nextSibling())
        write(ts, *child, indent + 1);
}
Exemple #20
0
void ATemplateNodeHandler_LUA::Node::fromAFile(AFile& aFile)
{
  AString endToken;
  endToken.append('/');
  endToken.append(getTagName());

  m_BlockData.clear();

  //a_Locate end tag in file if not found throw exception, MUST have end
  if (AConstant::npos == aFile.readUntil(m_BlockData, endToken))
  {
    aFile.readUntilEOF(m_BlockData);
  }
  else
  {
    m_BlockData.rremoveUntilNotOneOf(AXmlElement::sstr_StartOrWhitespace);
    aFile.skipUntilNotOneOf(AXmlElement::sstr_EndOrWhitespace);
  }
  //a_Allow derived nodes to process data after read
  _handleDataAfterRead();
}
std::ostream& ossimNitfCsproaTag::print(std::ostream& out,
                            const std::string& prefix) const
{
   std::string pfx = prefix;
   pfx += getTagLength();
   pfx += ".";
   out << setiosflags(ios::left)
       << pfx << std::setw(24) << "CETAG:"      << getTagName() << "\n"
       << pfx << std::setw(24) << "CEL:"        << getTagLength() << "\n"
       << pfx << std::setw(24) << "RESERVED1:"   << m_reserved1 << "\n"
       << pfx << std::setw(24) << "RESERVED2:"   << m_reserved2 << "\n"
       << pfx << std::setw(24) << "RESERVED3:"   << m_reserved3 << "\n"
       << pfx << std::setw(24) << "RESERVED4:"   << m_reserved4 << "\n"
       << pfx << std::setw(24) << "RESERVED5:"   << m_reserved5 << "\n"
       << pfx << std::setw(24) << "RESERVED6:"   << m_reserved6 << "\n"
       << pfx << std::setw(24) << "RESERVED7:"   << m_reserved7 << "\n"
       << pfx << std::setw(24) << "RESERVED8:"   << m_reserved8 << "\n"
       << pfx << std::setw(24) << "RESERVED9:"   << m_reserved9 << "\n"
       << pfx << std::setw(24) << "BWC:"   << m_bwc << "\n";

    return out;   
}
Exemple #22
0
/**
 * Creates new opening text from current attributes. This function scans
 * all parsed attributes (that includes newly added ones created through
 * setAttribute() call) and creates new opening text (including the tag
 * name and braces, of course); attributes are separated by single
 * space and all values are double-qouted.
 * 
 */
void HtmlNode::unparseAttributes() {
	if (!isTag()) {
		return;
	}
	
	std::string opening("<");
	opening.append(getTagName());
	
	
	Attributes::iterator e = attributes_.end();
	for (Attributes::iterator it = attributes_.begin(); it != e; ++it) {
		// FIXME - this shall be done nicer (somehow)
		opening.append(" ");
		opening.append(it->first);
		opening.append("=\"");
		opening.append(it->second);
		opening.append("\"");
    }
	
	//FIXME - add /> on empty tags
	opening.append(">");
	openingText_ = opening;
}
void VerbatimXmlComponent::renderBegin() const {
	auto context = getContext();

	auto attribs = getRenderAttributes(context);

	/*we ALWAYS use the provided id for plain xml tags, regardless of naming
	 *containers etc. this means plain html will always work as expected - and
	 *no plain html component needs its id for anything other than css!*/
	auto& id = attribs["id"];
	auto sepPos = id.find_last_of(Component::NAMING_SEPARATOR);
	if (sepPos != id.npos) {
		id = id.substr(sepPos + 1);
	}
	
	//the root element needs to declare the xhtml namespace
	if (getTagName() == "html"
		&& attribs.find("xmlns") == attribs.end()) {
		attribs["xmlns"] = "http://www.w3.org/1999/xhtml";
	}

	getWriter() <<"<" <<impl->getOriginalTag() <<Util::toString(attribs) <<">"
			<<context->evaluateString(getTextValue());
}
Exemple #24
0
/// Load parameter value from XML.
///
/// @param xmlDocument XML document to load from
///
void Parameter::loadFromXml(XmlElement *xmlDocument)
{
    float realValue;

    // get parameter's element from XML document
    XmlElement *xmlParameter = xmlDocument->getChildByName(getTagName());

    // parameter's element found
    if (xmlParameter)
    {
        // get stored value from attribute "value" (or use default
        // real value)
        realValue = (float) xmlParameter->getDoubleAttribute("value", getDefaultRealFloat());
    }
    // otherwise
    else
    {
        // use default real value
        realValue = getDefaultRealFloat();
    }

    // update real value
    setRealFloat(realValue);
}
Exemple #25
0
int ofxGuiObject::saveObjectData()
{
	int id	= mGlobals->mXml.addTag("OBJECT");
	
	mGlobals->mXml.setValue("OBJECT:ID", mParamId, id);
	mGlobals->mXml.setValue("OBJECT:TYPE", getTagName(), id);
	mGlobals->mXml.setValue("OBJECT:NAME", mParamName, id);

	mGlobals->mXml.setValue("OBJECT:LEFT", mObjX, id);
	mGlobals->mXml.setValue("OBJECT:TOP", mObjY, id);
	//	mGlobals->mXml.setValue("OBJECT:WIDTH", mObjWidth, id);
	//	mGlobals->mXml.setValue("OBJECT:HEIGHT", mObjHeight, id);
	
	//	mGlobals->mXml.setValue("OBJECT:CTRX", mCtrX, id);
	//	mGlobals->mXml.setValue("OBJECT:CTRY", mCtrY, id);
	
	mGlobals->mXml.setValue("OBJECT:WIDTH", mCtrWidth, id);
	mGlobals->mXml.setValue("OBJECT:HEIGHT", mCtrHeight, id);
	
	mGlobals->mXml.setValue("OBJECT:DISPLAY", mDisplay, id);
	mGlobals->mXml.setValue("OBJECT:STEPS", mSteps, id);
	
	return id;
}
Exemple #26
0
int main(int argc, char* argv[])
{
  if (argc != 3)
  {
    std::cerr << "usage: PListMerger"
              << " <first-plist-content>"
              << " <second-plist-content>" << std::endl;
    return 1;
  }

  const std::vector<std::string> args{argv, argv + argc};

  const juce::ScopedPointer<juce::XmlElement> firstPlistElement =
    juce::XmlDocument::parse(args.at(1));
  if (!firstPlistElement || !firstPlistElement->hasTagName("plist"))
  {
    std::cerr << "Invalid first plist content, expected <plist> element" << std::endl;
    return 1;
  }

  const auto firstDictElement = firstPlistElement->getChildByName("dict");
  if (!firstDictElement)
  {
    std::cerr << "Invalid first plist content, expected <dict> element" << std::endl;
    return 1;
  }

  std::vector<std::string> keysInFirstPlist;

  for (auto childElement = firstDictElement->getFirstChildElement();
       childElement != nullptr; childElement = childElement->getNextElement())
  {
    if (childElement->getTagName() != "key" || childElement->getNumChildElements() != 1
        || !childElement->getFirstChildElement()->isTextElement())
    {
      std::cerr << "Invalid first plist content, expected <key> element with only one "
                   "text child element"
                << std::endl;
      return 1;
    }

    const auto key = childElement->getFirstChildElement()->getText().toStdString();

    if (std::find(keysInFirstPlist.begin(), keysInFirstPlist.end(), key)
        != keysInFirstPlist.end())
    {
      std::cerr << "Invalid first plist content, duplicated key \"" << key << "\""
                << std::endl;
      return 1;
    }

    keysInFirstPlist.push_back(key);

    childElement = childElement->getNextElement();
    if (childElement == nullptr)
    {
      std::cerr << "Invalid first plist content, missing value associated with key \""
                << key << "\"" << std::endl;
      return 1;
    }
  }

  const juce::ScopedPointer<juce::XmlElement> secondPlistElement =
    juce::XmlDocument::parse(args.at(2));
  if (!secondPlistElement || !secondPlistElement->hasTagName("plist"))
  {
    std::cerr << "Invalid second plist content, expected <plist> element" << std::endl;
    return 1;
  }

  const auto secondDictElement = secondPlistElement->getChildByName("dict");
  if (!secondDictElement)
  {
    std::cerr << "Invalid second plist content, expected <dict> element" << std::endl;
    return 1;
  }

  for (auto childElement = secondDictElement->getFirstChildElement();
       childElement != nullptr; childElement = childElement->getNextElement())
  {
    if (childElement->getTagName() != "key" || childElement->getNumChildElements() != 1
        || !childElement->getFirstChildElement()->isTextElement())
    {
      std::cerr << "Invalid second plist content, expected <key> element with only one "
                   "text child element"
                << std::endl;
      return 1;
    }

    const auto key = childElement->getFirstChildElement()->getText().toStdString();

    const auto isKeyAlreadyInFirstPlist =
      std::find(keysInFirstPlist.begin(), keysInFirstPlist.end(), key)
      != keysInFirstPlist.end();

    if (!isKeyAlreadyInFirstPlist)
    {
      firstDictElement->addChildElement(new juce::XmlElement(*childElement));
    }

    childElement = childElement->getNextElement();
    if (childElement == nullptr)
    {
      std::cerr << "Invalid second plist content, missing value associated with key \""
                << key << "\"" << std::endl;
      return 1;
    }

    if (!isKeyAlreadyInFirstPlist)
    {
      firstDictElement->addChildElement(new juce::XmlElement(*childElement));
    }
  }

  std::cout << firstPlistElement->createDocument(juce::String{}, false, false)
            << std::flush;

  return 0;
}
std::ostream& ossimNitfRsmpcaTag::print(std::ostream& out,
                                      const std::string& prefix) const
{
   std::string pfx = prefix;
   pfx += getTagName();
   pfx += ".";

   out << setiosflags(std::ios::left)
       << pfx << std::setw(24) << "CETAG:" << getTagName() << "\n"
       << pfx << std::setw(24) << "CEL:" << getSizeInBytes() << "\n"
       << pfx << std::setw(24) << "IID:" << m_iid << "\n" 
       << pfx << std::setw(24) << "EDITION:" << m_edition << "\n"
       << pfx << std::setw(24) << "RSN:" << m_rsn << "\n" 
       << pfx << std::setw(24) << "CSN:" << m_csn << "\n"
       << pfx << std::setw(24) << "RFEP:" << m_rfep << "\n" 
       << pfx << std::setw(24) << "CFEP:" << m_cfep << "\n"
       << pfx << std::setw(24) << "RNRMO:" << m_rnrmo << "\n" 
       << pfx << std::setw(24) << "CNRMO:" << m_cnrmo << "\n"                
       << pfx << std::setw(24) << "XNRMO:" << m_xnrmo << "\n"                
       << pfx << std::setw(24) << "YNRMO:" << m_ynrmo << "\n"                
       << pfx << std::setw(24) << "ZNRMO:" << m_znrmo << "\n"                
       << pfx << std::setw(24) << "RNRMSF:" << m_rnrmsf << "\n"                
       << pfx << std::setw(24) << "CNRMSF:" << m_cnrmsf << "\n"
       << pfx << std::setw(24) << "XNRMSF:" << m_xnrmsf << "\n"
       << pfx << std::setw(24) << "YNRMSF:" << m_ynrmsf << "\n"
       << pfx << std::setw(24) << "ZNRMSF:" << m_znrmsf << "\n"
       << pfx << std::setw(24) << "RNPWRX:" << m_rnpwrx << "\n"
       << pfx << std::setw(24) << "RNPWRY:" << m_rnpwry << "\n"
       << pfx << std::setw(24) << "RNPWRZ:" << m_rnpwrz << "\n"
       << pfx << std::setw(24) << "RNTRMS:" << m_rntrms << "\n"
       << pfx << std::setw(24) << "RDPWRX:" << m_rdpwrx << "\n"
       << pfx << std::setw(24) << "RDPWRY:" << m_rdpwry << "\n"
       << pfx << std::setw(24) << "RDPWRZ:" << m_rdpwrz << "\n"
       << pfx << std::setw(24) << "RDTRMS:" << m_rdtrms << "\n"
       << pfx << std::setw(24) << "CNPWRX:" << m_rnpwrx << "\n"
       << pfx << std::setw(24) << "CNPWRY:" << m_rnpwry << "\n"
       << pfx << std::setw(24) << "CNPWRZ:" << m_rnpwrz << "\n"
       << pfx << std::setw(24) << "CNTRMS:" << m_rntrms << "\n"
       << pfx << std::setw(24) << "CDPWRX:" << m_rdpwrx << "\n"
       << pfx << std::setw(24) << "CDPWRY:" << m_rdpwry << "\n"
       << pfx << std::setw(24) << "CDPWRZ:" << m_rdpwrz << "\n"
       << pfx << std::setw(24) << "CDTRMS:" << m_rdtrms << "\n";


   ossim_uint32 i;
   ossimString s;
   
   for (i=0; i<m_rowNumNumTerms; ++i)
   {
      s = ossimString(RNPCF_KW);
      s += ossimString::toString(i);
      s += ":";
      out << pfx << std::setw(24) << s
          << m_rnpcf[i] << "\n";
   }
   for (i=0; i<m_rowDenNumTerms; ++i)
   {
      s = ossimString(RDPCF_KW);
      s += ossimString::toString(i);
      s += ":";
      out << pfx << std::setw(24) << s
          << m_rdpcf[i] << "\n";
   }
   for (i=0; i<m_colNumNumTerms; ++i)
   {
      s = ossimString(CNPCF_KW);
      s += ossimString::toString(i);
      s += ":";
      out << pfx << std::setw(24) << s
          << m_cnpcf[i] << "\n";
   }
   for (i=0; i<m_colDenNumTerms; ++i)
   {
      s = ossimString(CDPCF_KW);
      s += ossimString::toString(i);
      s += ":";
      out << pfx << std::setw(24) << s
          << m_cdpcf[i] << "\n";
   }

   out.flush();
   
   return out;
}
std::ostream& ossimNitfRpcBase::print(std::ostream& out,
                                      const std::string& prefix) const
{
   std::string pfx = prefix;
   pfx += getTagName();
   pfx += ".";

   out << setiosflags(std::ios::left)
       << pfx << std::setw(24) << "CETAG:"
       << getTagName() << "\n"
       << pfx << std::setw(24) << "CEL:"
       << getSizeInBytes() << "\n"
       << pfx << std::setw(24) << "SUCCESS:"
       << theSuccess << "\n" 
       << pfx << std::setw(24) << "ERR_BIAS:"
       << theErrorBias << "\n"
       << pfx << std::setw(24) << "ERR_RAND:"
       <<theErrRand  << "\n" 
       << pfx << std::setw(24) << "LINE_OFF:"
       << theLineOffset << "\n"
       << pfx << std::setw(24) << "SAMP_OFF:"
       << theSampleOffset << "\n" 
       << pfx << std::setw(24) << "LAT_OFF:"
       << theGeodeticLatOffset << "\n"
       << pfx << std::setw(24) << "LONG_OFF:"
       << theGeodeticLonOffset << "\n" 
       << pfx << std::setw(24) << "HEIGHT_OFF:"
       << theGeodeticHeightOffset << "\n"
       << pfx << std::setw(24) << "LINE_SCALE:"
       << theLineScale  << "\n" 
       << pfx << std::setw(24)
       << "SAMP_SCALE:" << theSampleScale << "\n"
       << pfx << std::setw(24) << "LAT_SCALE:"
       << theGeodeticLatScale << "\n" 
       << pfx << std::setw(24) << "LONG_SCALE:"
       << theGeodeticLonScale << "\n"
       << pfx << std::setw(24) << "HEIGHT_SCALE:"
       << theGeodeticHeightScale << "\n";

   ossim_int32 i;
   ossimString s;
   
   for (i=0; i<LINE_NUMERATOR_COEFFICIENT_COUNT; ++i)
   {
      s = "LINE_NUM_COEFF_";
      s += ossimString::toString(i);
      s += ":";
      out << pfx << std::setw(24) << s
          << theLineNumeratorCoefficient[i] << "\n";
   }

   for (i=0; i<LINE_DENOMINATOR_COEFFICIENT_COUNT; ++i)
   {
      s = "LINE_DEN_COEFF_";
      s += ossimString::toString(i);
      s += ":";
      out << pfx << std::setw(24) << s
          << theLineDenominatorCoefficient[i] << "\n";
   }

   for (i=0; i<LINE_NUMERATOR_COEFFICIENT_COUNT; ++i)
   {
      s = "SAMP_NUM_COEFF_";
      s += ossimString::toString(i);
      s += ":";
      out << pfx << std::setw(24) << s
          << theSampleNumeratorCoefficient[i] << "\n";
   }

   for (i=0; i<LINE_DENOMINATOR_COEFFICIENT_COUNT; ++i)
   {
      s = "SAMP_DEN_COEFF_";
      s += ossimString::toString(i);
      s += ":";
      out << pfx << std::setw(24) << s
          << theSampleDenominatorCoefficient[i] << "\n";
   }

   out.flush();
   
   return out;
}
void ATemplateNodeHandler_MODEL::debugDump(std::ostream& os, int indent) const
{
  ADebugDumpable::indent(os, indent) << "(" << typeid(*this).name() << "@ " << std::hex << this << std::dec << ") {" << std::endl;
  ADebugDumpable::indent(os, indent) << "TAGNAME=" << getTagName() << std::endl;
  ADebugDumpable::indent(os, indent) << "}" << std::endl;
}
Exemple #30
0
void
DLVertex :: Print ( std::ostream& o ) const
{
	o << "[d(" << getDepth(true) << "/" << getDepth(false)
	  << "),s(" << getSize(true) << "/" << getSize(false)
	  << "),b(" << getBranch(true) << "/" << getBranch(false)
	  << "),g(" << getGener(true) << "/" << getGener(false)
	  << "),f(" << getFreq(true) << "/" << getFreq(false) << ")] ";
	o << getTagName();

	switch ( Type() )
	{
	case dtAnd:		// nothing to do (except for printing operands)
	case dtSplitConcept:
		break;

	case dtTop:		// nothing to do
	case dtNN:
		return;

	case dtDataExpr:
		o << ' ' << *static_cast<const TDataEntry*>(getConcept())->getFacet();
		return;

	case dtDataValue:	// named entry -- just like concept names
	case dtDataType:

	case dtPConcept:
	case dtNConcept:
	case dtPSingleton:
	case dtNSingleton:
		o << '(' << getConcept()->getName() << ") " << (isNNameTag(Type()) ? "=" : "[=") << ' ' << getC();
		return;

	case dtLE:
		o << ' ' << getNumberLE() << ' ' << getRole()->getName() << ' ' << getC();
		return;

	case dtForall:
		o << ' ' << getRole()->getName() << '{' << getState() << '}' << ' ' << getC();
		return;

	case dtIrr:
		o << ' ' << getRole()->getName();
		return;

	case dtProj:
		o << ' ' << getRole()->getName() << ", " << getC() << " => " << getProjRole()->getName();
		return;

	case dtChoose:
		o << ' ' << getC();
		return;

	default:
		std::cerr << "Error printing vertex of type " << getTagName() << "(" << Type() << ")";
		fpp_unreachable();
	}

	// print operands of the concept constructor
	for ( const_iterator q = begin(); q != end(); ++q )
		o << ' ' << *q;
}