This commit is contained in:
Thulinma 2011-10-20 22:02:45 +02:00
parent 32ffc09f0e
commit bce0cda879
18 changed files with 13 additions and 326 deletions

19
tools/AMF_Tester/Makefile Normal file
View file

@ -0,0 +1,19 @@
SRC = main.cpp ../../util/amf.cpp
OBJ = $(SRC:.cpp=.o)
OUT = AMFtest
INCLUDES =
CCFLAGS = -Wall -Wextra -funsigned-char -g
CC = $(CROSS)g++
LD = $(CROSS)ld
AR = $(CROSS)ar
LIBS = -lssl -lcrypto
.SUFFIXES: .cpp
.PHONY: clean default
default: $(OUT)
.cpp.o:
$(CC) $(INCLUDES) $(CCFLAGS) -c $< -o $@
$(OUT): $(OBJ)
$(CC) $(LIBS) -o $(OUT) $(OBJ)
clean:
rm -rf $(OBJ) $(OUT) Makefile.bak *~

22
tools/AMF_Tester/main.cpp Normal file
View file

@ -0,0 +1,22 @@
/// \file AMF_Tester/main.cpp
/// Debugging tool for AMF data.
/// Expects AMF data through stdin, outputs human-readable information to stderr.
#define DEBUG 10 //maximum debugging level
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
#include "../../util/amf.h"
/// Debugging tool for AMF data.
/// Expects AMF data through stdin, outputs human-readable information to stderr.
int main() {
std::string temp;
while (std::cin.good()){temp += std::cin.get();}//read all of std::cin to temp
temp.erase(temp.size()-1, 1);//strip the invalid last character
AMF::Object amfdata = AMF::parse(temp);//parse temp into an AMF::Object
amfdata.Print();//pretty-print the object
return 0;
}