| 
									
										
										
										
											2015-02-12 23:16:25 +08:00
										 |  |  | // Aseprite
 | 
					
						
							|  |  |  | // Copyright (C) 2001-2015  David Capello
 | 
					
						
							|  |  |  | //
 | 
					
						
							| 
									
										
										
										
											2016-08-27 04:02:58 +08:00
										 |  |  | // This program is distributed under the terms of
 | 
					
						
							|  |  |  | // the End-User License Agreement for Aseprite.
 | 
					
						
							| 
									
										
										
										
											2012-01-06 06:45:03 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-08-06 08:20:19 +08:00
										 |  |  | #ifdef HAVE_CONFIG_H
 | 
					
						
							| 
									
										
										
										
											2012-01-06 06:45:03 +08:00
										 |  |  | #include "config.h"
 | 
					
						
							| 
									
										
										
										
											2013-08-06 08:20:19 +08:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "app/xml_exception.h"
 | 
					
						
							| 
									
										
										
										
											2012-01-06 06:45:03 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "tinyxml.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <cstdio>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-08-06 08:20:19 +08:00
										 |  |  | namespace app { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-15 06:58:11 +08:00
										 |  |  | XmlException::XmlException(const TiXmlDocument* doc) throw() | 
					
						
							| 
									
										
										
										
											2012-01-06 06:45:03 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   try { | 
					
						
							|  |  |  |     char buf[4096];             // TODO Overflow
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     sprintf(buf, "Error in XML file '%s' (line %d, column %d)\nError %d: %s", | 
					
						
							|  |  |  |             doc->Value(), doc->ErrorRow(), doc->ErrorCol(), | 
					
						
							|  |  |  |             doc->ErrorId(), doc->ErrorDesc()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     setMessage(buf); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   catch (...) { | 
					
						
							|  |  |  |     // No throw
 | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-08-06 08:20:19 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | } // namespace app
 |