Changeset 514 for branches


Ignore:
Timestamp:
04/09/14 16:45:51 (5 years ago)
Author:
jls17
Message:
  • added functionality to get image into a string
Location:
branches/work_311/output
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/work_311/output/ImageTag.cpp

    r513 r514  
    147147                return image.ToStream(strm); 
    148148        } 
     149 
     150        ImageTag::operator std::string() const 
     151        { 
     152                stringstream strm; 
     153                ToStream(strm); 
     154                return strm.str(); 
     155        } 
    149156}; // end namespace OUTPUT 
  • branches/work_311/output/ImageTag.h

    r507 r514  
    5656 
    5757                std::ostream& ToStream(std::ostream &strm) const; 
     58 
     59                operator string() const; 
    5860        private: 
    5961                int rootLevel; 
  • branches/work_311/output/ImageTagTest.cpp

    r502 r514  
    1919        ASSERT_STREQ("<img src=\"../img/schema.gif\" width=\"16\" height=\"16\" alt=\"schema.gif\" />", result.c_str()); 
    2020} 
     21 
     22TEST(ImageTag, ObjInstToString) 
     23{        
     24        string result = OUTPUT::ImageTag(OUTPUT::ImageTag::ActiveLink, 1); 
     25        ASSERT_STREQ("<img src=\"../img/active_link.gif\" width=\"16\" height=\"16\" alt=\"active_link.gif\" />", result.c_str()); 
     26} 
Note: See TracChangeset for help on using the changeset viewer.