没有为所有类生成文档

时间:2012-01-18 15:43:49

标签: c++ documentation doxygen

我有两个课程LinkMetaData(下面的代码)。这些类位于同一文件夹中。但是,在Doxygen生成的文档中,类Link已记录,但类MetaData未记录。任何想法为什么会这样?

链接:

#include <string.h>
#include <dbus-c++/dbus.h>

#ifndef LINK_H_
#define LINK_H_

typedef ::DBus::Struct< std::string, std::string > Link_Dbus_t;

class Link {

private:

const char* mUrl;
const char* mExpirationDate;

public:
Link();
virtual ~Link();
Link(const Link& l);

void setUrl(const char* url);
void setExpirationDate(const char* date);

const char* getUrl();
const char* getExpirationDate();

void operator << (const Link_Dbus_t& link_info);
};

Link_Dbus_t& operator << (Link_Dbus_t& link_info, Link& link);

#endif /* LINK_H_ */

的元数据:

#include <vector>
#include <iostream>
#include <string.h>
#include <dbus-c++/dbus.h>
#include "MetadataAttributes.h"

using namespace std;

#ifndef METADATA_H_
#define METADATA_H_

typedef vector< metadataStruct_Dbus_t >  metadataVector_Dbus_t;


class MetaData : public vector <MetadataAttributes> {

private:

const char* mSize;
const char* mRev;
const char* mModified;
const char* mPath;
const char* mIcon;
const char* mRoot;
const char* mMimeType;
const char* mHash;

int mRevision;
int mBytes;

bool mThumbExists;
bool mIsDir;
bool mIsDeleted;

vector<MetaData> mLinkedMetaData;


public:

enum ePrintWhat {

    PRINT_METADATA_OF_FILES_AND_FOLDERS,
    PRINT_REVISION_FILES,
    PRINT_SEARCHED_FILES,
    PRINT_RESTORED_FILE,
    PRINT_COPIED_FILE,
    PRINT_CREATED_FOLDER,
    PRINT_DELETED_FILE_OR_FOLDER,
    PRINT_MOVED_FILE
};

MetaData();
virtual ~MetaData();
MetaData(const MetaData& m);

void setSize(const char* size);
void setRev(const char* rev);
void setModified(const char* modified);
void setPath(const char* path);
void setIcon(const char* icon);
void setRoot(const char* root);
void setMimeType(const char* mimeType);
void setHash(const char* hash);
void setRevision(int revision);
void setBytes(int bytes);
void thumbExists(bool thumbExists);
void isDir(bool isDir);
void isDeleted(bool isDeleted);

const char* getSize();
const char* getRev();
const char* getModified();
const char* getPath();
const char* getIcon();
const char* getRoot();
const char* getMimeType();
const char* getHash();
int getRevision();
int getBytes();
bool thumbExists();
bool isDir();
bool isDeleted();


vector<MetaData>* getLinkedMetaData();

void printMetadata(ePrintWhat printWhat);

void operator << (const metadataVector_Dbus_t data_vec);

};

metadataVector_Dbus_t &operator << (metadataVector_Dbus_t& s1, const MetaData &s2);

#endif /* METADATA_H_ */

编辑: 我发现当我隔离MetaData和Session这两个类时,没有记录MetaData类。以任何方式存在文件冲突。 这是Session类:

#include <iostream>
#include "Account.h"
#include "MetaData.h"
#include "Link.h"
#include "WatchThread.h"
#include <map>
#include <json/json.h>
#include <oauth.h>
#include <string.h>
#include <curl/curl.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <pthread.h>
#include <sys/time.h>


using namespace std;

#ifndef SESSION_H_
#define SESSION_H_

class Session {

private:

typedef void (*TransferFinishedCallback)(unsigned int,const char*);
typedef void (*WatchCallback)(unsigned int, const char*, bool,bool);
typedef void (*WatchThreadInitedCallback)(unsigned int);

unsigned int mThread_id;

map<unsigned int,WatchThread> mWatchThreads;
map<unsigned int,pthread_t> mDownloadThreads;
map<unsigned int,pthread_t> mUploadThreads;

const char* mConsumer_key;
const char* mConsumer_secret;

const char* mRequestToken;
const char* mRequestTokenSecret;

const char* mAccessToken;
const char* mAcccessTokenSecret;


bool jsonParseErrorIsOccured(const char* c);
void jsonParseLink(json_object* jobj,Link *link);
void jsonParseAccountInfo(json_object* jobj, Account *account);
void jsonParseMetadata(json_object* jobj,MetaData *metadata);
void jsonParseArray(json_object* jobj, char* key, MetaData *metadata);
void parseTokenAndSecretValueFromString(const char* s, const char* &token, const     char* &secret);
char* getMetaDataUrl(const char* fileOrFolderPath, const char* hash, bool list, bool include_deleted, const char* rev);

public:

Session();
Session(const char* mConsumer_key,const char* mConsumer_secret);
virtual ~Session();
Session(const Session& s);

struct arg_struct;
struct watch_struct;

const char* login();

bool login(const char* accessToken, const char* accessTokenSecret);

void acquireAccessToken(const char* &accessToken, const char* &accessTokenSecret);

bool userIsAuthorized();

Account* getAccountInfo();

MetaData* getMetaDataOfFileOrFolder(const char* fileOrFolderPath,const char* hash, bool list, bool include_deleted,
        const char* rev);

MetaData* getMetDataOfFileRevisions(const char* filePath,const char* revLimit);

unsigned int getFile(const char* filePath,const char* targetFilePath, const char* rev, TransferFinishedCallback callback);

void stopDownloading(unsigned int id);

unsigned int putFile(const char* filePath, const char* targetFilePath,bool overwrite, const char* parent_rev, TransferFinishedCallback callback);

void stopUploading(unsigned int id);

MetaData* restoreFileToRevision(const char* filePath, const char* rev);

MetaData* searchForFileInFolder(const char* folderPath,const char* query,const char* fileLimit, bool include_deleted);

Link* createShareableLink(const char* fileOrFolderPath);

Link* getLinkToFile(const char* filepath);

unsigned int getThumbnail(const char* imageFilePath, const char* format, const char* size, const char* targetFilePath, TransferFinishedCallback callback);

MetaData* copyFolderOrFileTo(const char* root,const char* from_path, const char* to_path);

MetaData* createFolder(const char* root, const char* targetPath);

MetaData* deleteFileOrFolder(const char* root, const char* fileOrFolderPath);

MetaData* moveFileOrFolderTo(const char* root, const char* from_path, const char* to_path);

unsigned int watchFileOrFolder(const char* fileOrFolderPath, unsigned int updateInterval,WatchCallback callback_finish,WatchThreadInitedCallback callback_init, bool recursive);

const char* getRequestToken();

const char* getRequestTokenSecret();

const char* getAccessToken();

const char* getAccessTokenSecret();

void deleteWatchThreadWithId(unsigned int id);

void stopWatchThread(unsigned int id);

vector<int> runningWatchThreads();

vector<int> runningDownloadThreads();

vector<int> runningUploadThreads();

void setAccessToken(const char* accessToken, const char* accessTokenSecret);

};

#endif /* SESSION_H_ */

1 个答案:

答案 0 :(得分:1)

有两种可能的原因,或者Doxygen配置文件中的错误,或者目录中另一个文件的冲突。

要查看Doxygen配置文件,请生成默认Doxyfiledoxygen -s -g),并查看默认配置与您使用的版本之间的差异。对于任何差异,您可能需要尝试将值设置为Doxyfile中的默认值,以确定是否会产生影响。请特别注意EXTRACT_*HIDE_*SHOW_*选项。

要确定它是否可能是文件冲突,请暂时从目录中删除所有其他文件,并确定是否单独生成文档。如果是,则重新添加文件,直到不再生成该类,然后查看添加的文件以确定可能导致与MetaData冲突的内容。如果即使是隔离也没有记录,请再次查看Doxygen配置文件。

作为实验,我将临时目录中描述的两个文件与Doxygen 1.7.6.1中的默认生成Doxyfile放在一起。这两个类都有记录,但是他们的成员没有链接。更改Doxyfile以指定EXTRACT_ALL=YES会导致所有成员都被记录下来。