{
    "content": [
        {
            "type": "text",
            "text": "# Archive::Zip::MemberRead (perldoc)\n\n## NAME\n\nArchive::Zip::MemberRead - A wrapper that lets you read Zip archive members as if they were files.\n\n## SYNOPSIS\n\nuse Archive::Zip;\nuse Archive::Zip::MemberRead;\n$zip = Archive::Zip->new(\"file.zip\");\n$fh  = Archive::Zip::MemberRead->new($zip, \"subdir/abc.txt\");\nwhile (defined($line = $fh->getline()))\n{\nprint $fh->inputlinenumber . \"#: $line\\n\";\n}\n$read = $fh->read($buffer, 32*1024);\nprint \"Read $read bytes as :$buffer:\\n\";\n\n## DESCRIPTION\n\nThe Archive::Zip::MemberRead module lets you read Zip archive member data just like you read\ndata from files.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (9 subsections)\n- **AUTHOR**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Archive::Zip::MemberRead",
        "section": "",
        "mode": "perldoc",
        "summary": "Archive::Zip::MemberRead - A wrapper that lets you read Zip archive members as if they were files.",
        "synopsis": "use Archive::Zip;\nuse Archive::Zip::MemberRead;\n$zip = Archive::Zip->new(\"file.zip\");\n$fh  = Archive::Zip::MemberRead->new($zip, \"subdir/abc.txt\");\nwhile (defined($line = $fh->getline()))\n{\nprint $fh->inputlinenumber . \"#: $line\\n\";\n}\n$read = $fh->read($buffer, 32*1024);\nprint \"Read $read bytes as :$buffer:\\n\";",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 19,
                "subsections": [
                    {
                        "name": "setLineEnd",
                        "lines": 5
                    },
                    {
                        "name": "rewind",
                        "lines": 3
                    },
                    {
                        "name": "input_record_separator",
                        "lines": 3
                    },
                    {
                        "name": "input_line_number",
                        "lines": 3
                    },
                    {
                        "name": "close",
                        "lines": 2
                    },
                    {
                        "name": "buffer_size",
                        "lines": 2
                    },
                    {
                        "name": "getline",
                        "lines": 5
                    },
                    {
                        "name": "getline",
                        "lines": 2
                    },
                    {
                        "name": "read",
                        "lines": 13
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Archive::Zip::MemberRead - A wrapper that lets you read Zip archive members as if they were\nfiles.\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Archive::Zip;\nuse Archive::Zip::MemberRead;\n$zip = Archive::Zip->new(\"file.zip\");\n$fh  = Archive::Zip::MemberRead->new($zip, \"subdir/abc.txt\");\nwhile (defined($line = $fh->getline()))\n{\nprint $fh->inputlinenumber . \"#: $line\\n\";\n}\n\n$read = $fh->read($buffer, 32*1024);\nprint \"Read $read bytes as :$buffer:\\n\";\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The Archive::Zip::MemberRead module lets you read Zip archive member data just like you read\ndata from files.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "Archive::Zip::Member::readFileHandle()\nYou can get a \"Archive::Zip::MemberRead\" from an archive member by calling\n\"readFileHandle()\":\n\nmy $member = $zip->memberNamed('abc/def.c');\nmy $fh = $member->readFileHandle();\nwhile (defined($line = $fh->getline()))\n{\n# ...\n}\n$fh->close();\n\nArchive::Zip::MemberRead->new($zip, $fileName)\nArchive::Zip::MemberRead->new($zip, $member)\nArchive::Zip::MemberRead->new($member)\nConstruct a new Archive::Zip::MemberRead on the specified member.\n\nmy $fh = Archive::Zip::MemberRead->new($zip, 'fred.c')\n",
                "subsections": [
                    {
                        "name": "setLineEnd",
                        "content": "Set the line end character to use. This is set to \\n by default except on Windows systems\nwhere it is set to \\r\\n. You will only need to set this on systems which are not Windows or\nUnix based and require a line end different from \\n. This is a class method so call as\n\"Archive::Zip::MemberRead\"->\"setLineEnd($nl)\"\n"
                    },
                    {
                        "name": "rewind",
                        "content": "Rewinds an \"Archive::Zip::MemberRead\" so that you can read from it again starting at the\nbeginning.\n"
                    },
                    {
                        "name": "input_record_separator",
                        "content": "If the argument is given, inputrecordseparator for this instance is set to it. The current\nsetting (which may be the global $/) is always returned.\n"
                    },
                    {
                        "name": "input_line_number",
                        "content": "Returns the current line number, but only if you're using \"getline()\". Using \"read()\" will\nnot update the line number.\n"
                    },
                    {
                        "name": "close",
                        "content": "Closes the given file handle.\n"
                    },
                    {
                        "name": "buffer_size",
                        "content": "Gets or sets the buffer size used for reads. Default is the chunk size used by Archive::Zip.\n"
                    },
                    {
                        "name": "getline",
                        "content": "Returns the next line from the currently open member. Makes sense only for text files. A\nread error is considered fatal enough to die. Returns undef on eof. All subsequent calls\nwould return undef, unless a rewind() is called. Note: The line returned has the\ninputrecordseparator (default: newline) removed.\n"
                    },
                    {
                        "name": "getline",
                        "content": "Returns the next line including the line ending.\n"
                    },
                    {
                        "name": "read",
                        "content": "Simulates a normal \"read()\" system call. Returns the no. of bytes read. \"undef\" on error, 0\non eof, *e.g.*:\n\n$fh = Archive::Zip::MemberRead->new($zip, \"sreeji/secrets.bin\");\nwhile (1)\n{\n$read = $fh->read($buffer, 1024);\ndie \"FATAL ERROR reading my secrets !\\n\" if (!defined($read));\nlast if (!$read);\n# Do processing.\n....\n}\n"
                    }
                ]
            },
            "AUTHOR": {
                "content": "Sreeji K. Das <sreejik@yahoo.com>\n\nSee Archive::Zip by Ned Konz without which this module does not make any sense!\n\nMinor mods by Ned Konz.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright 2002 Sreeji K. Das.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            }
        }
    }
}