Пример #1
0
void CombatText::addInt(int num, const FPoint& location, int displaytype) {
	if (settings->combat_text) {
		std::stringstream ss;
		ss << num;
		addString(ss.str(), location, displaytype);
	}
}
Пример #2
0
bool OSSerialize::addXMLStartTag(const OSMetaClassBase *o, const char *tagString)
{
	if (binary)
    {
		printf("class %s: xml serialize\n", o->getMetaClass()->getClassName());
		return (false);
	}

	if (!addChar('<')) return false;
	if (!addString(tagString)) return false;
	if (!addString(" ID=\"")) return false;
	if (!addString(((OSString *)tags->getObject((const OSSymbol *)o))->getCStringNoCopy())) 
		return false;
	if (!addChar('\"')) return false;
	if (!addChar('>')) return false;
	return true;
}
Пример #3
0
/* Copy font dict data from client specification. */
void cfwDictCopyFont(cfwCtx g, abfFontDict *dst, abfFontDict *src)
	{
	/* Copy all fields */
	*dst = *src;

	/* Add strings to index */
	addString(g, &dst->FontName);
	}
Пример #4
0
bool admJson::addCompressParam(const char *key, const COMPRES_PARAMS &param)
{
    char *str;
    ADM_compressWriteToString((COMPRES_PARAMS *)&param,&str);
    addString(key,str);
    ADM_dealloc(str);
    return true;
}
Пример #5
0
void PagePopupClient::addProperty(const char* name,
                                  unsigned value,
                                  SharedBuffer* data) {
  data->append(name, strlen(name));
  addLiteral(": ", data);
  addString(String::number(value), data);
  addLiteral(",\n", data);
}
Пример #6
0
void HeapGraphSerializer::reportEdge(const void*, const void* to, const char* name)
{
    HeapGraphEdge edge;
    ASSERT(to);
    edge.m_toObject = to;
    edge.m_name = addString(name);
    m_edges.append(edge);
}
Пример #7
0
void HeapGraphSerializer::reportLeaf(const void*, const WTF::MemoryObjectInfo& info, const char* edgeName)
{
    HeapGraphNode node;
    node.m_type = addString(info.objectType());
    node.m_size = info.objectSize();
    node.m_className = addString(info.className());
    node.m_name = addString(info.name());

    int nodeIndex = m_nodes.size();
    m_nodes.append(node);

    HeapGraphEdge edge;
    edge.m_toIndex = nodeIndex;
    edge.m_targetIndexIsKnown = true;
    edge.m_name = addString(edgeName);
    m_edges.append(edge);
}
Пример #8
0
static void handleStudyQueries(DUL_ASSOCIATIONKEY** association,
			       DUL_ASSOCIATESERVICEPARAMETERS* params,
			       MSG_C_FIND_REQ* patientRequest,
			       LST_HEAD* patientList,
			       const char* queryLevel)
{
  ITEM* item;
  CONDITION cond;
  MSG_C_FIND_RESP response;

  item = (ITEM*)LST_Head(&patientList);
  (void)LST_Position(&patientList, item);
  while (item != 0) {
    char* patientName;
    char* patientID;
    char* charSet;
    MSG_C_FIND_REQ studyRequest;
    DCM_OBJECT* q;

    patientName = getString(item->obj, DCM_PATNAME);
    patientID = getString(item->obj, DCM_PATID);
    charSet = getString(patientRequest->identifier, DCM_IDSPECIFICCHARACTER);

    printf("%s %s\n", patientID, patientName);

    studyRequest = *patientRequest;
    studyRequest.identifier = 0;
    DCM_CreateObject(&q, 0);

    addString(q, DCM_PATID, patientID);
    addString(q, DCM_IDSPECIFICCHARACTER, charSet);
    addString(q, DCM_IDQUERYLEVEL, "STUDY");
    addString(q, DCM_RELSTUDYINSTANCEUID, "");
    addString(q, DCM_IDSTUDYDATE, "");
    addString(q, DCM_IDSTUDYTIME, "");
    addString(q, DCM_IDACCESSIONNUMBER, "");
    addString(q, DCM_IDSTUDYDESCRIPTION, "");

    studyRequest.identifier = q;
    studyRequest.messageID = SRV_MessageIDOut();

    item->lst = LST_Create();

    cond = SRV_CFindRequest(association, params,
			    &studyRequest, &response,
			    queryCallback, item->lst, "");
    if (!(CTN_SUCCESS(cond))) {
      (void) printf("Verification Request unsuccessful\n");
      COND_DumpConditions();
    } else {

    }

    item = LST_Next(&patientList);
  }
}
Пример #9
0
static bool isEvents2Feature(const String &feature, const String &version)
{
    if (!version.isEmpty() && version != "2.0")
        return false;

    static bool initialized = false;
    DEFINE_STATIC_LOCAL(FeatureSet, events2Features, ());
    if (!initialized) {
        addString(events2Features, "Events");
        addString(events2Features, "HTMLEvents");
        addString(events2Features, "MouseEvents");
        addString(events2Features, "MutationEvents");
        addString(events2Features, "UIEvents");
        initialized = true;
    }
    return events2Features.contains(feature);
}
Пример #10
0
bool isValid(char* s1, int len1, char* s2, int len2, char* s3, int len3)
{
    if(*s1=='0' && len1>1) return false; //handle corner cases;
    if(*s2=='0' && len2>1) return false;
    if(len3 == 0) return true; //nothing left to compare, so far so good just return true;
    char* t = addString(s1, len1, s2, len2);
    int len = strlen(t);
    return strncmp(t, s3, len)==0 && isValid(s2, len2, t, len, s3+len, len3-len); //if the current round is valid then check the next round till the end;
}
Пример #11
0
//
// MetaTable::setString
//
// If the metatable already contains a metastring of the given name, it will
// be edited to have the provided value. Otherwise, a new metastring will be
// added to the table with that value. 
//
void MetaTable::setString(const char *key, const char *newValue)
{
   MetaString *obj;

   if(!(obj = getObjectKeyAndTypeEx<MetaString>(key)))
      addString(key, newValue);
   else
      obj->setValue(newValue);
}
Пример #12
0
OrcFile::OrcFile()
{
	std::unique_ptr<Section> nameSection = std::make_unique<Section>();
	nameSection->name = addString(*nameSection, "$strings");
	mNameSection = 0;

	mSectionMap.insert(std::pair<std::string, std::reference_wrapper<Section>>("$strings", *nameSection));
	mSectionList.push_back(std::move(nameSection));
}
Пример #13
0
	VCardNameParser() : StructurePrivateParser<VCard::NamePrivate, VCard::Name>(QLatin1String("N"))
	{
		QString *strings[] = {
			&m_data.family, &m_data.given, &m_data.middle,
			&m_data.prefix, &m_data.suffix
		};
		for (int i = 0, size = sizeof(strings)/sizeof(QString*); i < size; i++)
			addString(QLatin1String(vcardNameTypes[i]), strings[i]);
	}
Пример #14
0
	VCardPhotoParser() : StructurePrivateParser<VCard::PhotoPrivate, VCard::Photo>(QLatin1String("PHOTO"))
	{
		QString *strings[] = {
			&m_data.extval, &m_data.type
		};
		for (int i = 1, size = sizeof(strings)/sizeof(QString*); i < size; i++)
			addString(QLatin1String(vcardPhotoTypes[i]), strings[i]);
		addByteArray(QLatin1String(vcardPhotoTypes[0]), &m_data.binval);
	}
Пример #15
0
void ProtocolOld::disconnectClient(const std::string& message)
{
	auto output = OutputMessagePool::getOutputMessage();
	output->addByte(0x0A);
	output->addString(message);
	send(output);

	disconnect();
}
Пример #16
0
//
// MetaTable::setString
//
// If the metatable already contains a metastring of the given name, it will
// be edited to have the provided value. Otherwise, a new metastring will be
// added to the table with that value. 
//
void MetaTable::setString(const char *key, const char *newValue)
{
   MetaObject *obj;

   if(!(obj = getObjectKeyAndType(key, RTTI(MetaString))))
      addString(key, newValue);
   else
      static_cast<MetaString *>(obj)->setValue(newValue);
}
Пример #17
0
bool OSSerialize::addXMLEndTag(const char *tagString)
{

	if (!addChar('<')) return false;
	if (!addChar('/')) return false;
	if (!addString(tagString)) return false;
	if (!addChar('>')) return false;
	return true;
}
Пример #18
0
void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer)
{
    WebCore::DateComponents date;
    date.setMillisecondsSinceEpochForDate(m_parameters.minimum);
    String minString = date.toString();
    date.setMillisecondsSinceEpochForDate(m_parameters.maximum);
    String maxString = date.toString();
    String stepString = String::number(m_parameters.step);

    addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", writer);
    writer.addData(WebCore::pickerCommonCss, sizeof(WebCore::pickerCommonCss));
    writer.addData(WebCore::calendarPickerCss, sizeof(WebCore::calendarPickerCss));
    CString extraStyle = WebCore::RenderTheme::defaultTheme()->extraCalendarPickerStyleSheet();
    if (extraStyle.length())
        writer.addData(extraStyle.data(), extraStyle.length());
    addString("</style></head><body><div id=main>Loading...</div><script>\n"
               "window.dialogArguments = {\n", writer);
    addProperty("min", minString, writer);
    addProperty("max", maxString, writer);
    addProperty("step", stepString, writer);
    addProperty("required", m_parameters.required, writer);
    addProperty("currentValue", m_parameters.currentValue, writer);
    addProperty("locale", WebCore::defaultLanguage(), writer);
    addProperty("todayLabel", Platform::current()->queryLocalizedString(WebLocalizedString::CalendarToday), writer);
    addProperty("clearLabel", Platform::current()->queryLocalizedString(WebLocalizedString::CalendarClear), writer);
    addProperty("weekStartDay", WebCore::firstDayOfWeek(), writer);
    addProperty("monthLabels", WebCore::monthLabels(), writer);
    addProperty("dayLabels", WebCore::weekDayShortLabels(), writer);
    Direction dir = direction(WebCore::monthLabels()[0][0]);
    addProperty("isRTL", dir == RightToLeft || dir == RightToLeftArabic, writer);
    if (m_parameters.suggestionValues.size()) {
        addProperty("inputWidth", static_cast<unsigned>(m_parameters.anchorRectInRootView.width()), writer);
        addProperty("suggestionValues", m_parameters.suggestionValues, writer);
        addProperty("localizedSuggestionValues", m_parameters.localizedSuggestionValues, writer);
        addProperty("suggestionLabels", m_parameters.suggestionLabels, writer);
        addProperty("showOtherDateEntry", m_parameters.type == WebCore::InputTypeNames::date(), writer);
        addProperty("otherDateLabel", Platform::current()->queryLocalizedString(WebLocalizedString::OtherDateLabel), writer);
    }
    addString("}\n", writer);

    writer.addData(WebCore::pickerCommonJs, sizeof(WebCore::pickerCommonJs));
    writer.addData(WebCore::calendarPickerJs, sizeof(WebCore::calendarPickerJs));
    addString("</script></body>\n", writer);
}
Пример #19
0
HeapGraphSerializer::HeapGraphSerializer(InspectorFrontend::Memory* frontend)
    : m_frontend(frontend)
    , m_strings(Strings::create())
    , m_edges(Edges::create())
    , m_nodeEdgesCount(0)
    , m_nodes(Nodes::create())
    , m_baseToRealNodeIdMap(BaseToRealNodeIdMap::create())
{
    ASSERT(m_frontend);
    m_strings->addItem(String()); // An empty string with 0 index.

    memset(m_edgeTypes, 0, sizeof(m_edgeTypes));

    m_edgeTypes[WTF::PointerMember] = addString("weak");
    m_edgeTypes[WTF::OwnPtrMember] = addString("ownRef");
    m_edgeTypes[WTF::RefPtrMember] = addString("countRef");

    m_unknownClassNameId = addString("unknown");
}
Пример #20
0
OrcFile::Section &OrcFile::addSection(const std::string &name)
{
	std::unique_ptr<Section> section = std::make_unique<Section>();
	section->name = addString(*mSectionList[mNameSection], name);
	Section &ret = *section;
	mSectionMap.insert(std::pair<std::string, std::reference_wrapper<Section>>(name, *section));
	mSectionList.push_back(std::move(section));

	return ret;
}
Пример #21
0
long ComboBox::addString(UINT stringId)
{
    char_t* str = LoadString(stringId);
    if (NULL == str)
        return CB_ERRSPACE;

    long err = addString(str);
    free(str);
    return err;
}
Пример #22
0
void ProtocolLogin::disconnectClient(const std::string& message, uint16_t version)
{
	auto output = OutputMessagePool::getOutputMessage();

	output->addByte(version >= 1076 ? 0x0B : 0x0A);
	output->addString(message);
	send(output);

	disconnect();
}
Пример #23
0
void HeapGraphSerializer::reportEdgeImpl(const int toNodeId, const char* name, int memberType)
{
    ASSERT(memberType >= 0);
    ASSERT(memberType < WTF::LastMemberTypeEntry);

    m_edges->addItem(memberType);
    m_edges->addItem(addString(name));
    m_edges->addItem(toNodeId);

    ++m_nodeEdgesCount;
}
    /** Contains information about a selected kart. When send from the client
     *  to the server, it contains the number of local players (which 
     *  technically needs only to be sent once); when send from from the server
     *  to the clients this field instead contains the host id of the host
     *  selected the character. This allows the client to detect if a selected
     *  kart was not confirmed by the server (i.e. another client or the server
     *  has selected the kart first
     *  \param player_id The local player id.
     *  \param host_id If this value is specified (>-1), then this value is
     *                 used in the message instead of the number of local
     *                 players.
     */
    CharacterSelectedMessage(int player_id, int host_id=-1)  
        : Message(Message::MT_CHARACTER_INFO) 
    {
        m_kart_info         = race_manager->getLocalKartInfo(player_id);
        m_num_local_players = race_manager->getNumLocalPlayers();

        allocate(getCharLength()       // m_kart_info.getLocalPlayerId())
                +getStringLength(m_kart_info.getKartName())
                +m_kart_info.getPlayerName().size() + 1 // FIXME: encoding issues
                +getCharLength());     // m_num_local_players)
        addChar(m_kart_info.getLocalPlayerId());
        addString(m_kart_info.getKartName());
        addString(core::stringc(m_kart_info.getPlayerName().c_str()).c_str()); // FIXME: encoding issues
        // Piggy backing this information saves sending it as a separate 
        // message. It is actually only required in the first message
        if(host_id>-1)
            addChar(host_id);
        else
            addChar(race_manager->getNumLocalPlayers());
    }   // CharacterSelectedMessage
Пример #25
0
const wchar_t* StringTableW::addString(const char* str, unsigned int len/* = 0*/)
{
    if (str == NULL || str[0] == '\0')
        return emptyString();

    if (len == 0)
        len = strlen(str);

    String s = String::fromUTF8(str, len);
    return addString(s.characters(), s.length());
}
Пример #26
0
const char* StringTable::addString(const wchar_t* str, unsigned int len/* = 0*/)
{
    if (str == NULL || str[0] == L'\0')
        return emptyString();

    if (len == 0)
        len = wcslen(str);

    CString s = String(str, len).utf8();
    return addString(s.data(), s.length());
}
Пример #27
0
 bool LuaRunBuffer::addFile(const std::string &filename, bool blocking) {
     if (!_script.isValid()) {
         VRJLUA_MSG_START(dbgVRJLUA_BUFFER, MSG_WARNING)
             << "in AddFile, but init not run with a valid LuaScript state!"
             << VRJLUA_MSG_END(dbgVRJLUA_BUFFER, MSG_WARNING);
         return false;
     }
     std::ostringstream ss;
     ss << "dofile([==[" << filename << "]==])";
     return addString(ss.str(), blocking);
 }
Пример #28
0
AREXPORT bool ArStringInfoGroup::addStringString(
	const char *name, ArTypes::UByte2 maxLength,
	ArRetFunctor<const char *> *functor, const char *format)
{
  return addString(name, maxLength, 
	    (new ArGlobalFunctor4<char *, ArTypes::UByte2, 
	     ArRetFunctor<const char *> *, 
	     const char *>(&ArStringInfoHolderFunctions::stringWrapper, 
			   (char *)NULL, (ArTypes::UByte2) 0, 
			   functor, format)));
}
Пример #29
0
	VCardAddressParser() : StructurePrivateParser<VCard::AddressPrivate, VCard::Address>(QLatin1String("ADR"))
	{
		QString *strings[] = {
			&m_data.pobox, &m_data.extendedAddress, &m_data.street,
			&m_data.locality, &m_data.region, &m_data.pcode,
			&m_data.country
		};
		for (int i = 0, size = sizeof(strings)/sizeof(QString*); i < size; i++)
			addString(QLatin1String(vcardAddressFields[i]), strings[i]);
		addFlag(vcardAddressTypes, &m_data.types);
	}
Пример #30
0
void HeapGraphSerializer::addRootNode()
{
    for (size_t i = 0; i < m_roots.size(); i++)
        reportEdgeImpl(toNodeId(m_roots[i]), 0, m_edgeTypes[WTF::PointerMember]);

    m_nodes->addItem(addString("Root"));
    m_nodes->addItem(0);
    m_nodes->addItem(m_address2NodeIdMap.size());
    m_nodes->addItem(0);
    m_nodes->addItem(m_roots.size());
}