]> git.saurik.com Git - wxWidgets.git/commitdiff
Implement CanRead
authorSylvain Bougnoux <bougnoux@imra-europe.com>
Thu, 19 Aug 1999 08:24:22 +0000 (08:24 +0000)
committerSylvain Bougnoux <bougnoux@imra-europe.com>
Thu, 19 Aug 1999 08:24:22 +0000 (08:24 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3426 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/imagpnm.cpp

index d2b3244965c604172535172409f8ddd54dd91ca6..e46916c549379feb82e1ca647af31d9ec55e97e7 100644 (file)
@@ -138,7 +138,20 @@ bool wxPNMHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool WXUNUS
 
 bool wxPNMHandler::CanRead( wxInputStream& stream )
 {
-    return FALSE; // VS - temporary - FIXME
+    off_t pos=stream.TellI();
+
+    Skip_Comment(stream);
+
+    if (stream.GetC()==_T('P'))
+      switch (stream.GetC())
+       {
+       case _T('3'): case _T('6'):
+         stream.SeekI(pos);
+         return TRUE;
+       }
+
+    stream.SeekI(pos);
+    return FALSE;
 }