m_orgName,
m_orgDisplayName,
m_orgURL;
- typedef tuple< string,xstring,boost::shared_ptr<AttributeDecoder> > contact_tuple_t;
- typedef tuple< string,int,int,boost::shared_ptr<AttributeDecoder> > logo_tuple_t;
+ typedef boost::tuple< string,xstring,boost::shared_ptr<AttributeDecoder> > contact_tuple_t;
+ typedef boost::tuple< string,int,int,boost::shared_ptr<AttributeDecoder> > logo_tuple_t;
vector<contact_tuple_t> m_contacts; // tuple is attributeID, contact type, decoder
vector<logo_tuple_t> m_logos; // tuple is attributeID, height, width, decoder
attributes.push_back(m_orgDisplayName);
if (!m_orgURL.empty())
attributes.push_back(m_orgURL);
- static void (vector<string>::* push_back)(const string&) = &vector<string>::push_back;
- static const string& (contact_tuple_t::* tget)() const = &contact_tuple_t::get<0>;
- static const string& (logo_tuple_t::* tget2)() const = &logo_tuple_t::get<0>;
- for_each(m_contacts.begin(), m_contacts.end(), boost::bind(push_back, boost::ref(attributes), boost::bind(tget, _1)));
- for_each(m_logos.begin(), m_logos.end(), boost::bind(push_back, boost::ref(attributes), boost::bind(tget2, _1)));
+ for (vector<contact_tuple_t>::const_iterator c = m_contacts.begin(); c != m_contacts.end(); ++c)
+ attributes.push_back(c->get<0>());
+ for (vector<logo_tuple_t>::const_iterator l = m_logos.begin(); l != m_logos.end(); ++l)
+ attributes.push_back(l->get<0>());
}
void MetadataExtractor::extractAttributes(
if (!match)
match = objects.front();
- auto_ptr_char temp(match->getTextContent());
+ auto_arrayptr<char> temp(toUTF8(match->getTextContent()));
if (temp.get() && *temp.get()) {
auto_ptr<SimpleAttribute> attr(new SimpleAttribute(vector<string>(1, id)));
attr->getValues().push_back(temp.get());
if (request && request->startLangMatching()) {
do {
for (vector<Logo*>::const_iterator i = logos.begin(); i != logos.end(); ++i) {
- if (request->matchLang((*i)->getLang())) {
+ if (!(*i)->getLang() || request->matchLang((*i)->getLang())) {
sizediff = 0;
if (h > 0) {
dim = (*i)->getHeight();
- sizediff = abs(h - dim.second);
+ sizediff += abs(h - dim.second);
}
if (w > 0) {
dim = (*i)->getWidth();
sizediff = 0;
if (h > 0) {
dim = (*i)->getHeight();
- sizediff = abs(h - dim.second);
+ sizediff += abs(h - dim.second);
}
if (w > 0) {
dim = (*i)->getWidth();